|
1 | | -name: "Publish Docker" |
| 1 | +name: "Release" |
2 | 2 | on: |
| 3 | + # workflow_dispatch: |
3 | 4 | push: |
4 | 5 | tags: |
5 | 6 | - '*' # Push events to every tag |
6 | 7 |
|
7 | 8 | jobs: |
8 | | - publish: |
| 9 | + build-linux-binaries: |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - os: linux |
| 14 | + arch: '386' |
| 15 | + - os: linux |
| 16 | + arch: 'amd64' |
| 17 | + - os: linux |
| 18 | + arch: 'arm' |
| 19 | + extraArgs: "-cc arm-linux-gnueabi-gcc" |
| 20 | + - os: linux |
| 21 | + arch: 'arm64' |
| 22 | + extraArgs: "-cc aarch64-linux-gnu-gcc" |
9 | 23 | runs-on: ubuntu-latest |
10 | 24 | steps: |
11 | | - - uses: actions/checkout@v2 |
| 25 | + - uses: actions/checkout@v4 |
12 | 26 | - name: Set up Go |
13 | | - uses: actions/setup-go@v2 |
| 27 | + uses: actions/setup-go@v5 |
14 | 28 | with: |
15 | 29 | go-version: 1.21.4 |
16 | 30 |
|
| 31 | + - name: install gcc |
| 32 | + run: sudo apt-get update && sudo apt-get install gcc-multilib |
| 33 | + |
| 34 | + - name: setup gcc |
| 35 | + if: matrix.arch == 'arm' |
| 36 | + run: sudo apt-get install gcc-arm-linux-gnueabi |
| 37 | + |
| 38 | + - name: setup gcc |
| 39 | + if: matrix.arch == 'arm64' |
| 40 | + run: sudo apt-get install gcc-aarch64-linux-gnu |
| 41 | + |
| 42 | + - name: Build |
| 43 | + run: GOOS=${{ matrix.os }} go run build/ci.go install -dlgo --arch ${{ matrix.arch }} ${{ matrix.extraArgs }} |
| 44 | + |
| 45 | + - name: Prepare binary |
| 46 | + run: tar -czvf subquery-geth-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz ./build/bin/geth |
| 47 | + |
| 48 | + # TODO SHA-256 |
| 49 | + |
| 50 | + - name: Archive binary |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: subquery-geth-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz |
| 54 | + path: subquery-geth-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz |
| 55 | + |
| 56 | + release: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + needs: build-linux-binaries |
| 59 | + steps: |
| 60 | + |
| 61 | + - name: Download all binaries |
| 62 | + uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + path: artifacts |
| 65 | + |
| 66 | + - name: Inspect artifacts |
| 67 | + run: ls -R artifacts |
| 68 | + |
| 69 | + - name: Release |
| 70 | + uses: softprops/action-gh-release@v1 |
| 71 | + if: startsWith(github.ref, 'refs/tags/') |
| 72 | + with: |
| 73 | + files: artifacts/**/*.tar.gz |
| 74 | + |
| 75 | + ## This is working |
| 76 | + publish-docker: |
| 77 | + runs-on: ubuntu-latest |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + |
17 | 81 | - name: Set up QEMU |
18 | 82 | uses: docker/setup-qemu-action@v3 |
19 | 83 |
|
|
26 | 90 | username: subquerynetwork |
27 | 91 | password: ${{ secrets.SQ_DOCKERHUB_TOKEN }} |
28 | 92 |
|
29 | | - - name: Build Docker |
30 | | - run: go run build/ci.go docker -image -manifest amd64,arm64 -upload subquerynetwork/geth |
31 | | - |
32 | 93 | - name: Build and push |
33 | 94 | uses: docker/build-push-action@v5 |
34 | 95 | with: |
|
0 commit comments