-
Notifications
You must be signed in to change notification settings - Fork 4
187 lines (178 loc) · 7.38 KB
/
build_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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Build Release
on:
push:
pull_request:
workflow_dispatch:
env:
RELEASE_VERSION: ${{ github.ref_name }}
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
check-latest: true
cache: yarn
- name: Install dependencies
run: |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/
yarn install --frozen-lockfile
- name: Inject release info to the program
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "" > ./App/is_released_version
- name: Get version
if: matrix.os == 'ubuntu-latest'
id: get_version
run: echo "version=$(node deb_build_files/ci_prepare.js)" >> $GITHUB_OUTPUT
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: |
yarn run build:linux
cp dist/linux-unpacked/resources/app.asar dist/app.asar
# prepare for amd64 deb
mkdir -p dist/deb_temp_amd64/opt/
mkdir -p dist/deb_temp_amd64/usr/share/applications/
mkdir -p dist/deb_temp_amd64/usr/share/icons/
mkdir -p dist/deb_temp_amd64/DEBIAN/
echo -e "ln -s /opt/bbg/bbg /usr/bin/bbg" > dist/deb_temp_amd64/DEBIAN/postinst
chmod +x dist/deb_temp_amd64/DEBIAN/postinst
echo -e "rm -f /usr/bin/bbg" > dist/deb_temp_amd64/DEBIAN/prerm
chmod +x dist/deb_temp_amd64/DEBIAN/prerm
mv dist/linux-unpacked dist/deb_temp_amd64/opt/bbg
cp deb_build_files/bbg.desktop dist/deb_temp_amd64/usr/share/applications/
cp resources/icon.png dist/deb_temp_amd64/usr/share/icons/bbg.png
# prepare for arm64 deb
mkdir -p dist/deb_temp_arm64/opt/
mkdir -p dist/deb_temp_arm64/usr/share/applications/
mkdir -p dist/deb_temp_arm64/usr/share/icons/
mkdir -p dist/deb_temp_arm64/DEBIAN/
echo -e "ln -s /opt/bbg/bbg /usr/bin/bbg" > dist/deb_temp_arm64/DEBIAN/postinst
chmod +x dist/deb_temp_arm64/DEBIAN/postinst
echo -e "rm -f /usr/bin/bbg" > dist/deb_temp_arm64/DEBIAN/prerm
chmod +x dist/deb_temp_arm64/DEBIAN/prerm
mv dist/linux-arm64-unpacked dist/deb_temp_arm64/opt/bbg
cp deb_build_files/bbg.desktop dist/deb_temp_arm64/usr/share/applications/
cp resources/icon.png dist/deb_temp_arm64/usr/share/icons/bbg.png
- name: Pack amd64 deb
if: matrix.os == 'ubuntu-latest'
id: pack_amd64_deb
uses: jiro4989/build-deb-action@v3
with:
package: bbg
package_root: dist/deb_temp_amd64/
maintainer: bbg_contributors
version: ${{ steps.get_version.outputs.version }}
arch: amd64
desc: "A static blog generater made with Electron technology."
- name: Pack arm64 deb
if: matrix.os == 'ubuntu-latest'
id: pack_arm64_deb
uses: jiro4989/build-deb-action@v3
with:
package: bbg
package_root: dist/deb_temp_arm64/
maintainer: bbg_contributors
version: ${{ steps.get_version.outputs.version }}
arch: arm64
desc: "A static blog generater made with Electron technology."
- name: Clean
if: matrix.os == 'ubuntu-latest'
run: |
mv ${{ steps.pack_amd64_deb.outputs.file_name }} dist/bbg-amd64.deb
mv ${{ steps.pack_arm64_deb.outputs.file_name }} dist/bbg-arm64.deb
sudo rm -rf dist/deb_temp_amd64
sudo rm -rf dist/deb_temp_arm64
- name: Build Windows
if: matrix.os == 'windows-latest'
run: |
yarn run build:win
rm -r dist/win-unpacked
rm -r dist/win-arm64-unpacked
- name: Build macOS
if: matrix.os == 'macos-latest'
run: |
yarn run build:mac
rm -rf dist/mac
rm -rf dist/mac-arm64
- name: Show build files
run: |
ls dist
- name: Upload Linux artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: linux-artifact
path: |
dist/
- name: Upload Windows artifacts
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: |
dist/
- name: Upload macOS artifacts
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: macos-artifact
path: |
dist/
release:
needs:
- build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: |
dist/
- name: Prepare release
run: |
cd dist
mv -f linux-artifact/* .
mv -f windows-artifact/* .
mv -f macos-artifact/* .
rm -rf builder-debug.yml linux-artifact windows-artifact macos-artifact
mv bbg-amd64.deb bbg-${RELEASE_VERSION}-amd64.deb
mv bbg-arm64.dmg bbg-${RELEASE_VERSION}-arm64.dmg
mv bbg-x64.dmg bbg-${RELEASE_VERSION}-x64.dmg
mv bbg-x64.exe bbg-${RELEASE_VERSION}-setup-x64.exe
mv bbg-x64.tar.gz bbg-${RELEASE_VERSION}-x64-linux.tar.gz
mv bbg-x86_64.AppImage bbg-${RELEASE_VERSION}-x86_64.AppImage
mv bbg-arm64.dmg.blockmap bbg-${RELEASE_VERSION}-arm64.dmg.blockmap
mv bbg-x64.dmg.blockmap bbg-${RELEASE_VERSION}-x64.dmg.blockmap
mv bbg-x64.exe.blockmap bbg-${RELEASE_VERSION}-x64.exe.blockmap
mv bbg-arm64.deb bbg-${RELEASE_VERSION}-arm64.deb
mv bbg-arm64.exe bbg-${RELEASE_VERSION}-arm64.exe
shasum -a 256 * > SHA256SUMS
cd ..
- name: Show file structure
run: |
tree -a
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Version ${{ github.ref_name }} / 版本 ${{ github.ref_name }}
draft: false
prerelease: false
body: |
The program package supports most desktop operating systems e.g., macOS, Windows, and Linux. The current version supports [many languages](https://github.com/bbg-contributors/bbg-lang) as application language, despite the support for languages other than Chinese is currently experimental, so bugs may occur. If you have any suggestions or feedback, please send them to [GitHub Issues](https://github.com/bbg-contributors/bbg/issues/new). We will process them in our spare time.
[Changelog](https://bbg.nekomoe.xyz/#/en/CHANGELOG)
---
本项目支持 macOS、Windows、Linux 等常见桌面平台。目前应用程序支持[多种语言](https://github.com/bbg-contributors/bbg-lang),但对中文以外的语言的支持目前仍是实验性的,因而可能会出现 Bug。如果你有任何意见或建议,请将它们发送到 [GitHub Issues](https://github.com/bbg-contributors/bbg/issues/new) 中。我们会在空余时间处理这些问题。
[更新日志](https://bbg.nekomoe.xyz/#/zh-cn/CHANGELOG)
files: |
dist/*