-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
78 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Build and cache" | ||
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: Build and cache | ||
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: | ||
- name: Build the package | ||
working-directory: ./packages/${{ inputs.package-name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
run: | | ||
# We just need to set a git tag. None of the rest of this matters. | ||
git init | ||
git config user.email "[email protected]" | ||
git config user.name "Your Name" | ||
git add . | ||
git commit -m "Test" | ||
git remote add origin https://example.com | ||
git tag "${{ inputs.package-version }}" | ||
# Build the package | ||
goreleaser release --clean --nightly --skip=announce,publish,validate | ||
- name: Cache the packages | ||
uses: actions/cache/save@v4 | ||
id: cache-packages | ||
with: | ||
key: "${{ inputs.package-name }}-${{ inputs.package-version }}" | ||
path: packages/${{ inputs.package-name }}/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,42 +73,27 @@ jobs: | |
run: | | ||
echo "::add-mask::${AWSSSEKMSID}" | ||
# We'll use amzn2-x86_64 as a proxy for all packages pushed to S3. | ||
aws s3api head-object \ | ||
--bucket "${PACKAGE_BUCKET}" \ | ||
--key "rpm/amazonlinux/2/x86_64/tenv-${package_version}-1.x86_64.rpm" 2>&1 \ | ||
&& echo "::notice title=Package exists::We don't need to rebuild, so let's stop the build here." \ | ||
&& echo "already_built=true" >> $GITHUB_OUTPUT \ | ||
|| true | ||
- name: Build the package | ||
if: steps.check.outputs.already_built != 'true' | ||
working-directory: ./packages/tenv | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
run: | | ||
# We just need to set a git tag. None of the rest of this matters. | ||
git init | ||
git config user.email "[email protected]" | ||
git config user.name "Your Name" | ||
git add . | ||
git commit -m "Test" | ||
git remote add origin https://example.com | ||
git tag "${package_version}" | ||
# Build the package | ||
goreleaser release --clean --nightly --skip=announce,publish,validate | ||
- name: Cache the packages | ||
uses: actions/cache/save@v4 | ||
id: cache-packages | ||
with: | ||
key: "tenv-${package_version}" | ||
path: packages/tenv/dist | ||
build: | ||
if: needs.lookup.outputs.already_built != 'true' | ||
needs: lookup | ||
name: Build and cache | ||
uses: northwood-labs/package-building/.github/workflows/build-and-cache.yml@main | ||
secrets: inherit | ||
with: | ||
package-name: tenv | ||
package-version: "${package_version}" | ||
|
||
upload: | ||
if: needs.lookup.outputs.already_built != 'true' | ||
needs: lookup | ||
needs: build | ||
name: Upload to S3 | ||
uses: northwood-labs/package-building/.github/workflows/upload-to-s3.yml@main | ||
secrets: inherit | ||
|