-
Notifications
You must be signed in to change notification settings - Fork 179
72 lines (69 loc) · 2.65 KB
/
tools.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# This workflow is used to build and upload the node bootstrapping tools
name: Build Tools
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag/commit'
required: true
type: string
promote:
description: 'Promote to official boot-tools?'
required: false
type: boolean
env:
GO_VERSION: "1.22"
jobs:
build-publish:
name: Build boot tools
runs-on: ubuntu-latest
steps:
- name: Print all input variables
run: echo '${{ toJson(inputs) }}' | jq
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCR_SERVICE_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: flow
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout repo
uses: actions/checkout@v3
with:
# to accurately get the version tag
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Build and upload boot-tools
run: |
make tool-bootstrap tool-transit
mkdir boot-tools
mv bootstrap transit boot-tools/
sha256sum boot-tools/bootstrap > boot-tools/bootstrap.sha256sum
cat boot-tools/bootstrap.sha256sum
sha256sum boot-tools/transit > boot-tools/transit.sha256sum
cat boot-tools/transit.sha256sum
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
sha256sum util > util.sha256sum
cat util.sha256sum
tar -czf util.tar util util.sha256sum
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
SUMMARY=$'# Tool Build and Upload Summary \n Your tools were uploaded to the following GCS objects \n * Boot Tools gs://flow-genesis-bootstrap/boot-tools.tar \n * Util util.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/util.tar'
else
echo "not promoting boot-tools.tar"
SUMMARY=$'# Tool Build and Upload Summary \n Your tools were uploaded to the following GCS objects \n * Boot Tools gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/boot-tools.tar \n * Util util.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/util.tar'
fi
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY