@@ -9,29 +9,98 @@ permissions:
99 contents : write
1010
1111jobs :
12- release :
12+ build_fe :
1313 runs-on : ubuntu-latest
1414 steps :
1515 - name : Checkout
1616 uses : actions/checkout@v4
1717 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
2319 - name : Set up Node
2420 uses : actions/setup-node@v4
2521 with :
2622 node-version : 21
2723 - name : Build
24+ working-directory : frontend
2825 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/
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') }}
3153 uses : goreleaser/goreleaser-action@v5
3254 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, 'linux') }}
58+ run : |
59+ sudo apt-get -y gcc-aarch64-linux-gnu gcc-mingw-w64 gcc-multilib
60+ - name : Build for Linux
61+ if : ${{ startsWith(matrix.os, 'linux') }}
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, 'linux') }}
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
36101 env :
37102 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