-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (79 loc) · 2.2 KB
/
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
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
# This workflow will build this project
name: Build
on:
release:
types: [created]
permissions:
contents: write
pull-requests: read
jobs:
build:
strategy:
matrix:
include:
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: freebsd
goarch: amd64
- goos: linux
goarch: amd64
tested: '1'
- goos: linux
goarch: 386
- goos: linux
goarch: arm64
- goos: linux
goarch: arm
goarm: 5
- goos: linux
goarch: arm
goarm: 6
- goos: linux
goarch: arm
goarm: 7
- goos: linux
goarch: s390x
# remove windows for mount mechanism
# - goos: windows
# goarch: amd64
fail-fast: false
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
OSARCH_TESTED: ${{ matrix.tested }}
CGO_ENABLED: 0
steps:
- name: Set env
run: |
if [[ $OSARCH_TESTED == '1' ]]; then
echo "TARGET_NAME=${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOARM }}" >> $GITHUB_ENV
else
echo "TARGET_NAME=${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOARM }}-experimental" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
with:
ref: "${{ env.RELEASE_VERSION }}"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '20'
- name: Build
run: ./build.sh
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./yatm-${{ env.TARGET_NAME }}-${{ env.RELEASE_VERSION }}.tar.gz
asset_name: yatm-${{ env.TARGET_NAME }}-${{ env.RELEASE_VERSION }}.tar.gz
asset_content_type: application/x-tgz