-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (64 loc) · 2.3 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
name: Release
on:
push:
tags:
- '*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
matrix:
goos: [ linux, darwin, windows ]
goarch: [ amd64, arm64 ]
include:
- goos: windows
ext : ".exe"
exclude:
- goos: windows
goarch: arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: goid_init
run: chmod +x goid_init.sh && ./goid_init.sh
- name: Build FE
run: npm install vite -g --save && cd viewer && npm install --dependencies && npm run build
- name: Update example
run: go test -v -run TestExample ./instr
- name: Release Example And Ellyn
run: cd example && go build -v -o example_app${{ matrix.ext }} . && cd ../cmd && go build -v -o ellyn${{ matrix.ext }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
# 把二进制文件打包成压缩文件
- name: Prepare Packaging
run: cd example && zip -v example-${{ matrix.goos }}-${{ matrix.goarch }}.zip example_app${{ matrix.ext }} && cd ../cmd && zip -v ellyn-${{ matrix.goos }}-${{ matrix.goarch }}.zip ellyn${{ matrix.ext }}
- name: Upload Example Artifacts
uses: actions/upload-artifact@v3
with:
name: example-${{ matrix.goos }}-${{ matrix.goarch }}.zip
path: example/example-${{ matrix.goos }}-${{ matrix.goarch }}.zip
- name: Upload Ellyn Artifacts
uses: actions/upload-artifact@v3
with:
name: ellyn-${{ matrix.goos }}-${{ matrix.goarch }}.zip
path: cmd/ellyn-${{ matrix.goos }}-${{ matrix.goarch }}.zip
# 发布release版本
- name: Release version
uses: ncipollo/release-action@v1
#if: github.event_name == 'release'
with:
allowUpdates: true
prerelease: false
artifactErrorsFailBuild: true
removeArtifacts: false
replacesArtifacts: false
artifacts: example/example-${{ matrix.goos }}-${{ matrix.goarch }}.zip,cmd/ellyn-${{ matrix.goos }}-${{ matrix.goarch }}.zip
token: ${{ secrets.GITHUB_TOKEN }}