-
Notifications
You must be signed in to change notification settings - Fork 197
65 lines (55 loc) · 1.65 KB
/
build-darwin.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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
L1_NETWORK_NAME: testnet
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
- darwin/amd64
- darwin/arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
context: .
file: .github/workflows/Dockerfile
platforms: ${{ matrix.platform }}
load: true
tags: initia:${{ github.sha }}
- name: Export binary
run: |
platform=${{ matrix.platform }}
os=${platform%/*}
arch=${platform#*/}
container_id=$(docker create initia:${{ github.sha }})
docker cp $container_id:/app ./app
tar -czvf initia_${{ github.sha }}_${os^}_${arch}.tar.gz -C app .
docker rm $container_id
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Upload to GCS
run: |
platform=${{ matrix.platform }}
os=${platform%/*}
arch=${platform#*/}
gsutil cp initia_${{ github.sha }}_${os^}_${arch}.tar.gz gs://your-bucket-name/networks/${{ env.L1_NETWORK_NAME }}/binaries/