Skip to content

Commit

Permalink
Try an e2e build.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Mar 29, 2024
1 parent 5c291fa commit ce8b80b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 21 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/build-tenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,16 @@ jobs:
# Build the package
goreleaser release --clean --nightly --skip=announce,publish,validate
- name: Upload to S3
if: steps.check.outputs.already_built != 'true'
working-directory: ./packages/tenv/dist
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWSSSEKMSID: "${{ secrets.AWSSSEKMSID }}"
PACKAGE_BUCKET: ${{ vars.PACKAGE_BUCKET }}
run: |
# rpm, x86_64
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" tenv*.x86_64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2/x86_64/"
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" tenv*.x86_64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2023/x86_64/"
# rpm, aarch64
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" tenv*.aarch64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2/aarch64/"
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" tenv*.aarch64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2023/aarch64/"
upload:
if: needs.lookup.outputs.already_built != 'true'
needs: lookup
name: Upload to S3
uses: northwood-labs/package-building/.github/workflows/upload-to-s3.yml@main
secrets: inherit

metadata:
if: needs.lookup.outputs.already_built != 'true'
needs: lookup
needs: upload
name: Generate metadata
uses: northwood-labs/package-building/.github/workflows/generate-rpm-meta.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/generate-rpm-meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ jobs:
options: --privileged

steps:
- name: "Update Amazon Linux metadata"
env:
- env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
AWS_REGION: ${{ vars.AWS_REGION }}
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/upload-to-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: "Step: Upload to S3"
on:
workflow_call:
inputs:
package-name:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Variables available to all jobs defined in this file
env:
DOCKER_BUILDKIT: 1
REGISTRY: ${{ vars.REGISTRY }}

# Declare default permissions as read only.
permissions: read-all

jobs:
generate:
runs-on: ubuntu-latest
name: Upload to S3
strategy:
fail-fast: false

container:
image: ghcr.io/northwood-labs/package-builder/ubuntu-v22.04:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged

steps:
- working-directory: ./packages/${{ inputs.package-name }}/dist
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWSSSEKMSID: "${{ secrets.AWSSSEKMSID }}"
PACKAGE_BUCKET: ${{ vars.PACKAGE_BUCKET }}
run: |
# rpm, x86_64
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" ${{ inputs.package-name }}*.x86_64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2/x86_64/"
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" ${{ inputs.package-name }}*.x86_64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2023/x86_64/"
# rpm, aarch64
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" ${{ inputs.package-name }}*.aarch64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2/aarch64/"
aws s3 cp --sse=aws:kms --sse-kms-key-id="${AWSSSEKMSID}" ${{ inputs.package-name }}*.aarch64.rpm "s3://${PACKAGE_BUCKET}/rpm/amazonlinux/2023/aarch64/"

0 comments on commit ce8b80b

Please sign in to comment.