Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add github action to build boot-tools on demand - v0.29 backport #3807

Merged
merged 2 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Tools

on:
workflow_dispatch:
inputs:
tag:
description: 'Tagged commit to build tools against'
required: true
type: string
promote:
description: 'Should this build be promoted to the official boot-tools?'
required: false
type: boolean

jobs:
build-publish:
name: Build boot tools
runs-on: ubuntu-latest
steps:
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCR_SERVICE_KEY }} # TODO: we need a new key to allow uploads
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: flow
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
- name: Build relic
run: make crypto_setup_gopath
- name: Build and upload boot-tools
run: |
make tool-bootstrap tool-transit
mkdir boot-tools
mv bootstrap transit boot-tools/
tar -czf boot-tools.tar ./boot-tools/
gsutil cp boot-tools.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/boot-tools.tar
- name: Build and upload util
run: |
make tool-util
tar -czf util.tar util
gsutil cp util.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/util.tar
- name: Promote boot-tools
run: |
if [[ "${{ inputs.promote }}" = true ]]; then
echo "promoting boot-tools.tar"
gsutil cp boot-tools.tar gs://flow-genesis-bootstrap/boot-tools.tar
else
echo "not promoting boot-tools.tar"
fi
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ docker-all-tools: tool-util tool-remove-execution-fork

PHONY: docker-build-util
docker-build-util:
docker build -f cmd/Dockerfile --ssh default --build-arg TARGET=./cmd/util --build-arg GOARCH=$(GOARCH) --target production \
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/util --build-arg GOARCH=$(GOARCH) --target production \
-t "$(CONTAINER_REGISTRY)/util:latest" -t "$(CONTAINER_REGISTRY)/util:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/util:$(IMAGE_TAG)" .

PHONY: tool-util
Expand Down