@@ -9,29 +9,98 @@ permissions:
9
9
contents : write
10
10
11
11
jobs :
12
- release :
12
+ build_fe :
13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
- name : Checkout
16
16
uses : actions/checkout@v4
17
17
with :
18
- fetch-depth : 0 # for goreleaser generating changelog
19
- - name : Set up Go
20
- uses : actions/setup-go@v5
21
- with :
22
- go-version : " 1.22"
18
+ fetch-depth : 0
23
19
- name : Set up Node
24
20
uses : actions/setup-node@v4
25
21
with :
26
22
node-version : 21
27
23
- name : Build
24
+ working-directory : frontend
28
25
run : |
29
- ./scripts.sh build
30
- - name : Run GoReleaser
26
+ npm i && npm run build
27
+ - name : Upload dist
28
+ uses : actions/upload-artifact@v4
29
+ with :
30
+ name : fe_dist
31
+ path : frontend/build
32
+ retention-days : 1
33
+ build_be :
34
+ needs : build_fe
35
+ strategy :
36
+ matrix :
37
+ os : [ubuntu-latest, macos-latest]
38
+ runs-on : ${{ matrix.os }}
39
+ steps :
40
+ - name : Checkout
41
+ uses : actions/checkout@v4
42
+ - name : Download the dist of FE
43
+ uses : actions/download-artifact@v4
44
+ with :
45
+ name : fe_dist
46
+ path : frontend/build/
47
+ - name : Set up Go
48
+ uses : actions/setup-go@v5
49
+ with :
50
+ go-version : " 1.22"
51
+ - name : Build for Darwin
52
+ if : ${{ startsWith(matrix.os, 'macos') }}
31
53
uses : goreleaser/goreleaser-action@v5
32
54
with :
33
- distribution : goreleaser
34
- version : latest
35
- args : release --clean
55
+ args : release --skip=publish --clean --config .goreleaser.darwin.yaml
56
+ - name : Prepare for Linux and Windows
57
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
58
+ run : |
59
+ sudo apt-get install -y gcc-aarch64-linux-gnu gcc-mingw-w64
60
+ - name : Build for Linux
61
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
62
+ uses : goreleaser/goreleaser-action@v5
63
+ with :
64
+ args : release --skip=publish --clean --config .goreleaser.linux.yaml
65
+ - name : Build for Windows
66
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
67
+ uses : goreleaser/goreleaser-action@v5
68
+ with :
69
+ args : release --skip=publish --clean --config .goreleaser.windows.yaml
70
+ - name : Upload dist
71
+ uses : actions/upload-artifact@v4
72
+ with :
73
+ name : " be_${{ matrix.os }}_dist"
74
+ path : |
75
+ dist/*.zip
76
+ dist/*_checksums.txt
77
+ retention-days : 1
78
+ publish :
79
+ needs : [build_be]
80
+ runs-on : ubuntu-latest
81
+ steps :
82
+ - name : Create dist dir
83
+ run : |
84
+ mkdir -p ./dist/
85
+ - name : Download the dist of BE
86
+ uses : actions/download-artifact@v4
87
+ with :
88
+ pattern : be_*_dist
89
+ path : ./dist/
90
+ merge-multiple : true
91
+ - name : Merge checksums
92
+ working-directory : ./dist
93
+ run : |
94
+ cat *_checksums.txt >> checksums.txt
95
+ rm *_checksums.txt
96
+ - name : Checkout
97
+ uses : actions/checkout@v4
98
+ with :
99
+ fetch-depth : 0 # for goreleaser generating changelog
100
+ - name : Publish release
36
101
env :
37
102
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
103
+ uses : goreleaser/goreleaser-action@v5
104
+ with :
105
+ distribution : goreleaser
106
+ args : release --config .goreleaser.yaml
0 commit comments