-
Notifications
You must be signed in to change notification settings - Fork 176
66 lines (63 loc) · 2.35 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
# 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/
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
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