66 tags :
77 - " v[0-9]+.[0-9]+.[0-9]+"
88
9+ # ref https://docs.github.com/zh/actions/learn-github-actions/variables
10+ env :
11+ repo_name_android : " siyuan-android"
12+ repo_name : " siyuan"
13+ repo_owner : " siyuan-note"
14+ package_json : " app/package.json"
15+
916jobs :
1017 create_release :
1118 name : Create Release
@@ -17,10 +24,10 @@ jobs:
1724 packageManager : ${{ steps.packageManager.outputs.value }}
1825 steps :
1926 - name : Checkout code
20- uses : actions/checkout@v3
27+ uses : actions/checkout@v4
2128
2229 - name : Setup Python
23- uses : actions/setup-python@v3
30+ uses : actions/setup-python@v5
2431 with :
2532 python-version : " 3.10"
2633 - run : pip install PyGithub
3845 id : release_info
3946 run : |
4047 echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
41- echo "release_version=${GITHUB_REF#refs/*/} " >> $GITHUB_OUTPUT
42- changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} siyuan-community/siyuan )
48+ echo "release_version=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M') " >> $GITHUB_OUTPUT
49+ changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} ${{ env.repo_owner }}/${{ env.repo_name }} )
4350 EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
4451 echo "release_body<<$EOF" >> $GITHUB_ENV
4552 echo "$changelog" >> $GITHUB_ENV
@@ -51,13 +58,13 @@ jobs:
5158 uses : sergeysova/jq-action@v2
5259 id : version
5360 with :
54- cmd : ' jq .version app/package.json -r'
61+ cmd : ' jq .version ${{ env.package_json }} -r'
5562
5663 - name : Extract packageManager from package.json
5764 uses : sergeysova/jq-action@v2
5865 id : packageManager
5966 with :
60- cmd : " jq .packageManager app/package.json -r"
67+ cmd : " jq .packageManager ${{ env.package_json }} -r"
6168
6269 - name : Create Release
6370 id : create_release
@@ -72,41 +79,52 @@ jobs:
7279
7380 build :
7481 runs-on : ${{ matrix.config.os }}
82+ name : ${{ matrix.config.name }}
7583 needs : create_release
7684 strategy :
7785 matrix :
7886 config :
79- - os : ubuntu-20.04
87+ - os : ubuntu-22.04
88+ name : ubuntu build linux.AppImage
8089 kernel_path : " ../app/kernel-linux/SiYuan-Kernel"
81- build_args : " -s -w -X github.com/siyuan-community/siyuan/kernel/util.Mode=prod"
90+ build_args_prefix : " -s -w -X"
91+ build_args_suffix : " Mode=prod"
8292 electron_args : " dist-linux"
8393 goos : " linux"
8494 goarch : " amd64"
8595 suffix : " linux.AppImage"
86- - os : ubuntu-20.04
96+ - os : ubuntu-22.04
97+ name : ubuntu build linux.tar.gz
8798 kernel_path : " ../app/kernel-linux/SiYuan-Kernel"
88- build_args : " -s -w -X github.com/siyuan-community/siyuan/kernel/util.Mode=prod"
99+ build_args_prefix : " -s -w -X"
100+ build_args_suffix : " Mode=prod"
89101 electron_args : " dist-linux"
90102 goos : " linux"
91103 goarch : " amd64"
92104 suffix : " linux.tar.gz"
93105 - os : macos-latest
106+ name : macos build mac.dmg
94107 kernel_path : " ../app/kernel-darwin/SiYuan-Kernel"
95- build_args : " -s -w -X github.com/siyuan-community/siyuan/kernel/util.Mode=prod"
108+ build_args_prefix : " -s -w -X"
109+ build_args_suffix : " Mode=prod"
96110 electron_args : " dist-darwin"
97111 goos : " darwin"
98112 goarch : " amd64"
99113 suffix : " mac.dmg"
100114 - os : macos-latest
115+ name : macos build mac-arm64.dmg
101116 kernel_path : " ../app/kernel-darwin-arm64/SiYuan-Kernel"
102- build_args : " -s -w -X github.com/siyuan-community/siyuan/kernel/util.Mode=prod"
117+ build_args_prefix : " -s -w -X"
118+ build_args_suffix : " Mode=prod"
103119 electron_args : " dist-darwin-arm64"
104120 goos : " darwin"
105121 goarch : " arm64"
106122 suffix : " mac-arm64.dmg"
107- - os : windows-2019
123+ - os : windows-latest
124+ name : windows build win.exe
108125 kernel_path : " ../app/kernel/SiYuan-Kernel.exe"
109- build_args : " -s -w -H=windowsgui -X github.com/siyuan-community/siyuan/kernel/util.Mode=prod"
126+ build_args_prefix : " -s -w -H=windowsgui -X"
127+ build_args_suffix : " Mode=prod"
110128 electron_args : " dist"
111129 goos : " windows"
112130 gobin : " bin"
@@ -115,9 +133,9 @@ jobs:
115133 suffix : " win.exe"
116134
117135 steps :
118- - uses : actions/checkout@v3
136+ - uses : actions/checkout@v4
119137 with :
120- path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan
138+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}
121139
122140 - name : Set up MingGW
123141 uses : msys2/setup-msys2@v2
@@ -126,19 +144,20 @@ jobs:
126144 install : p7zip mingw-w64-x86_64-lua
127145
128146 - name : Set up TDM-GCC
129- run : msys2 -c "bash go/src/github.com/siyuan-community/siyuan /scripts/get-tdm-gcc.sh tdm https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm-1/tdm-gcc-10.3.0.exe" && echo "CC=${{ github.workspace }}/tdm/bin/gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
147+ run : msys2 -c "bash go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /scripts/get-tdm-gcc.sh tdm https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm-1/tdm-gcc-10.3.0.exe" && echo "CC=${{ github.workspace }}/tdm/bin/gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
130148 if : " contains( matrix.config.goarch, '386')"
131149 working-directory : ${{ github.workspace }}
132150
133151 - name : Set up Go
134- uses : actions/setup-go@v4
152+ uses : actions/setup-go@v5
135153 with :
136- go-version : " 1.22"
154+ go-version-file : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/go.mod
155+ - run : go version
137156
138157 - name : Set up goversioninfo
139158 run : go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
140159 if : " contains( matrix.config.goos, 'windows')"
141- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /kernel
160+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /kernel
142161 env :
143162 GO111MODULE : on
144163 CGO_ENABLED : 1
@@ -153,49 +172,49 @@ jobs:
153172
154173 - name : Install Node pnpm
155174 run : npm install -g ${{ needs.create_release.outputs.packageManager }}
156- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app
175+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app
157176
158177 - name : Install Node Dependencies
159178 run : pnpm install --no-frozen-lockfile
160- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app
161-
179+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app
180+
162181 - name : Building UI
163182 run : pnpm run build
164- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app
183+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app
165184
166185 - name : Remove Build Directory
167186 uses : JesseTG/rm@v1.0.2
168187 with :
169- path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app/build
188+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app/build
170189
171190 - name : Remove Kernel Directory for Linux
172191 uses : JesseTG/rm@v1.0.2
173192 with :
174- path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app/kernel-linux
193+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app/kernel-linux
175194
176195 - name : Remove Kernel Directory for Windows
177196 uses : JesseTG/rm@v1.0.2
178197 with :
179- path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app/kernel
198+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app/kernel
180199
181200 - name : Remove Kernel Directory for macOS
182201 uses : JesseTG/rm@v1.0.2
183202 with :
184- path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app/kernel-darwin
203+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app/kernel-darwin
185204
186205 - name : Remove Kernel Directory for macOS ARM64
187206 uses : JesseTG/rm@v1.0.2
188207 with :
189- path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app/kernel-darwin-arm64
208+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app/kernel-darwin-arm64
190209
191210 - name : Generate Icon Resource and Properties/Version Info For Windows
192211 run : ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
193212 if : " contains( matrix.config.goos, 'windows')"
194- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /kernel
213+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /kernel
195214
196215 - name : Building Kernel
197- run : go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args }}"
198- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /kernel
216+ run : go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/util.${{ matrix.config.build_args_suffix }}"
217+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /kernel
199218 env :
200219 GO111MODULE : on
201220 CGO_ENABLED : 1
@@ -205,14 +224,14 @@ jobs:
205224
206225 - name : Building Electron
207226 run : pnpm run ${{ matrix.config.electron_args }}
208- working-directory : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app
227+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app
209228
210229 - name : Upload Release
211230 uses : actions/upload-release-asset@v1
212231 env :
213232 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
214233 with :
215234 upload_url : ${{ needs.create_release.outputs.upload_url }}
216- asset_name : siyuan-CE- ${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
217- asset_path : ${{ github.workspace }}/go/src/github.com/siyuan-community/siyuan /app/build/siyuan-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
235+ asset_name : siyuan-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
236+ asset_path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }} /app/build/siyuan-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
218237 asset_content_type : application/octet-stream
0 commit comments