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 af114b7 commit eca042d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/build-tenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,27 @@ jobs:
# Build the package
goreleaser release --clean --nightly --skip=announce,publish,validate
metadata:
- name: Cache the packages
id: cache-packages
working-directory: ./packages/tenv
uses: actions/cache/save@v4
with:
key: "tenv-${package_version}"
path: dist

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
with:
package-name: tenv
package-version: "${package_version}"

metadata:
if: needs.lookup.outputs.already_built != 'true'
needs: upload
name: Generate metadata
uses: northwood-labs/package-building/.github/workflows/generate-rpm-meta.yml@main
secrets: inherit
67 changes: 67 additions & 0 deletions .github/workflows/upload-to-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
# 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
package-version:
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:
- uses: actions/cache/restore@v3
id: cache
working-directory: ./packages/${{ inputs.package-name }}
with:
key: "${{ input.package-name }}-${{ input.package-version }}"
path: dist

- 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 eca042d

Please sign in to comment.