forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (88 loc) · 2.8 KB
/
release.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: "Publish Docker"
on:
# workflow_dispatch:
push:
tags:
- '*' # Push events to every tag
jobs:
build-linux-binaries:
strategy:
matrix:
include:
- os: linux
arch: '386'
- os: linux
arch: 'amd64'
- os: linux
arch: 'arm'
extraArgs: "-cc arm-linux-gnueabi-gcc"
- os: linux
arch: 'arm64'
extraArgs: "-cc aarch64-linux-gnu-gcc"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.4
- name: install gcc
run: sudo apt-get update && sudo apt-get install gcc-multilib
- name: setup gcc
if: ${{ matrix.arch }} == arm
run: sudo apt-get install gcc-arm-linux-gnueabi
- name: setup gcc
if: ${{ matrix.arch }} == arm64
run: sudo apt-get install gcc-aarch64-linux-gnu
- name: Build
run: GOOS=${{ matrix.os }} go run build/ci.go install -dlgo --arch ${{ matrix.arch }} ${{ matrix.extraArgs }}
- name: Prepare binary
run: tar -czvf subquery-geth-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz ./build/bin/geth
# TODO SHA-256
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: subquery-geth-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz
path: subquery-geth-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz
release:
runs-on: ubuntu-latest
needs: build-linux-binaries
steps:
- name: Download all binaries
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Inspect artifacts
run: ls -R artifacts
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/*.tar.gz
## This is working
publish-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: subquerynetwork
password: ${{ secrets.SQ_DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: arm64,amd64
file: Dockerfile
# TODO bring back latest
tags: subquerynetwork/geth-client:${{ github.ref_name }}
build-args: |
COMMIT=${{github.sha}}
VERSION=${{github.ref_name}}
BUILDNUM=${{github.run_number}}