-
-
Notifications
You must be signed in to change notification settings - Fork 21
59 lines (59 loc) · 1.45 KB
/
cross-build.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
name: cross-build
on:
push:
branches:
- cross-build
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.matrix.outputs.versions }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate matrix
id: matrix
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
versions=$(make matrix)
echo $versions
echo "versions=$versions" >> $GITHUB_OUTPUT
build:
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(needs.matrix.outputs.go-version) }}
env:
SNAPSHOT: true
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: GO_VERSION=${{ matrix.go-version }} make build/ci
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.go-version }}
path: ${{ github.workspace }}/dist/