-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script and GH action to produce builds (#24)
This adds a shell script to create the .zip files for the checker and churner lambdas. It adds a set of github actions: try-release.yml just runs the build but doesn't do anything with it. This is runs on PRs and when they're pushed to main. release.yml runs the build and then uploads the artifacts to Github whenever a tag is pushed starting with "v" (which is how normal go release are tagged). I anticipate replacing this with uploading to S3 in a future PR, as we need them in S3 for lambda to deploy from.
- Loading branch information
1 parent
edad2ec
commit 625ba99
Showing
4 changed files
with
77 additions
and
0 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,23 @@ | ||
# Run the release flow | ||
# Keep in sync with try-release.yml | ||
|
||
name: Run release | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
- run: ./build-release.sh | ||
- name: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: "build/*.zip" | ||
if-no-files-found: error |
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,19 @@ | ||
# Try the release flow to ensure it works | ||
# Keep in sync with release.yml | ||
|
||
name: Try release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
try-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
- run: ./build-release.sh |
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 @@ | ||
/build/ |
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,34 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
# Build the pair of zip files to upload to lambda | ||
|
||
mkdir -p build | ||
DIR=$(mktemp -d "build/build-$(git rev-parse --short HEAD)-XXXXXX") | ||
echo "Building in $DIR" | ||
|
||
# Churner is just a binary | ||
mkdir -p "$DIR/churner" | ||
go build -o "$DIR/churner/bootstrap" lambda/churner/churner.go | ||
# zip | ||
pushd "$DIR/churner" | ||
zip churner.zip bootstrap | ||
popd | ||
cp "$DIR/churner/churner.zip" build/churner.zip | ||
|
||
|
||
# Checker binary and certs | ||
mkdir -p "$DIR/checker" | ||
go build -o "$DIR/checker/bootstrap" lambda/checker/checker.go | ||
|
||
# Include all the issuers | ||
# TODO(#23): Don't bake these into the release | ||
cp checker/testdata/*.pem "$DIR/checker/" | ||
|
||
# zip | ||
pushd "$DIR/checker" | ||
zip checker.zip bootstrap ./*.pem | ||
popd | ||
cp "$DIR/checker/checker.zip" build/checker.zip | ||
|
||
echo "built: build/churner.zip build/checker.zip" |