1010env :
1111 repo_name_android : " siyuan-android"
1212 repo_name : " siyuan"
13- repo_owner : " siyuan-note "
13+ repo_owner : " siyuan-community "
1414 package_json : " app/package.json"
1515
1616jobs :
3131 with :
3232 python-version : " 3.10"
3333 - run : pip install PyGithub
34-
34+
3535 - id : thislatestR
3636 uses : pozetroninc/github-action-get-latest-release@master
3737 with :
4545 id : release_info
4646 run : |
4747 echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
48- echo "release_version=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M') " >> $GITHUB_OUTPUT
48+ echo "release_version=${GITHUB_REF#refs/*/} " >> $GITHUB_OUTPUT
4949 changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} ${{ env.repo_owner }}/${{ env.repo_name }})
5050 EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
5151 echo "release_body<<$EOF" >> $GITHUB_ENV
@@ -58,13 +58,13 @@ jobs:
5858 uses : sergeysova/jq-action@v2
5959 id : version
6060 with :
61- cmd : ' jq .version ${{ env.package_json }} -r'
61+ cmd : " jq .version ${{ env.package_json }} -r"
6262
6363 - name : Extract packageManager from package.json
6464 uses : sergeysova/jq-action@v2
6565 id : packageManager
6666 with :
67- cmd : " jq .packageManager ${{ env.package_json }} -r"
67+ cmd : " jq .packageManager ${{ env.package_json }} -r"
6868
6969 - name : Create Release
7070 id : create_release
8484 strategy :
8585 matrix :
8686 config :
87- - os : ubuntu-22.04
87+ - os : ubuntu-latest
8888 name : ubuntu build linux.AppImage
8989 kernel_path : " ../app/kernel-linux/SiYuan-Kernel"
9090 build_args_prefix : " -s -w -X"
9393 goos : " linux"
9494 goarch : " amd64"
9595 suffix : " linux.AppImage"
96- - os : ubuntu-22.04
96+ - os : ubuntu-latest
9797 name : ubuntu build linux.tar.gz
9898 kernel_path : " ../app/kernel-linux/SiYuan-Kernel"
9999 build_args_prefix : " -s -w -X"
@@ -102,7 +102,7 @@ jobs:
102102 goos : " linux"
103103 goarch : " amd64"
104104 suffix : " linux.tar.gz"
105- - os : macos-latest
105+ - os : macos-latest-large
106106 name : macos build mac.dmg
107107 kernel_path : " ../app/kernel-darwin/SiYuan-Kernel"
108108 build_args_prefix : " -s -w -X"
@@ -111,7 +111,7 @@ jobs:
111111 goos : " darwin"
112112 goarch : " amd64"
113113 suffix : " mac.dmg"
114- - os : macos-latest
114+ - os : macos-latest-xlarge
115115 name : macos build mac-arm64.dmg
116116 kernel_path : " ../app/kernel-darwin-arm64/SiYuan-Kernel"
117117 build_args_prefix : " -s -w -X"
@@ -133,105 +133,105 @@ jobs:
133133 suffix : " win.exe"
134134
135135 steps :
136- - uses : actions/checkout@v4
137- with :
138- path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}
139-
140- - name : Set up MingGW
141- uses : msys2/setup-msys2@v2
142- if : " contains( matrix.config.goos, 'windows')"
143- with :
144- install : p7zip mingw-w64-x86_64-lua
145-
146- - name : Set up TDM-GCC
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
148- if : " contains( matrix.config.goarch, '386')"
149- working-directory : ${{ github.workspace }}
150-
151- - name : Set up Go
152- uses : actions/setup-go@v5
153- with :
154- go-version-file : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/go.mod
155- - run : go version
156-
157- - name : Set up goversioninfo
158- run : go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
159- if : " contains( matrix.config.goos, 'windows')"
160- working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
161- env :
162- GO111MODULE : on
163- CGO_ENABLED : 1
164- GOOS : ${{ matrix.config.goos }}
165- GOPATH : ${{ github.workspace }}/go
166- GOARCH : ${{ matrix.config.goarch }}
167-
168- - name : Set up Node
169- uses : actions/setup-node@v4
170- with :
171- node-version : 20
172-
173- - name : Install Node pnpm
174- run : npm install -g ${{ needs.create_release.outputs.packageManager }}
175- working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
176-
177- - name : Install Node Dependencies
178- run : pnpm install --no-frozen-lockfile
179- working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
180-
181- - name : Building UI
182- run : pnpm run build
183- working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
184-
185- - name : Remove Build Directory
186- uses : JesseTG/rm@v1.0.2
187- with :
188- path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/build
189-
190- - name : Remove Kernel Directory for Linux
191- uses : JesseTG/rm@v1.0.2
192- with :
193- path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-linux
194-
195- - name : Remove Kernel Directory for Windows
196- uses : JesseTG/rm@v1.0.2
197- with :
198- path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel
199-
200- - name : Remove Kernel Directory for macOS
201- uses : JesseTG/rm@v1.0.2
202- with :
203- path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin
204-
205- - name : Remove Kernel Directory for macOS ARM64
206- uses : JesseTG/rm@v1.0.2
207- with :
208- path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin-arm64
209-
210- - name : Generate Icon Resource and Properties/Version Info For Windows
211- run : ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
212- if : " contains( matrix.config.goos, 'windows')"
213- working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
214-
215- - name : Building 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
218- env :
219- GO111MODULE : on
220- CGO_ENABLED : 1
221- GOOS : ${{ matrix.config.goos }}
222- GOPATH : ${{ github.workspace }}/go
223- GOARCH : ${{ matrix.config.goarch }}
224-
225- - name : Building Electron
226- run : pnpm run ${{ matrix.config.electron_args }}
227- working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
228-
229- - name : Upload Release
230- uses : actions/upload-release-asset@v1
231- env :
232- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
233- with :
234- upload_url : ${{ needs.create_release.outputs.upload_url }}
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 }}
237- asset_content_type : application/octet-stream
136+ - uses : actions/checkout@v4
137+ with :
138+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}
139+
140+ - name : Set up MingGW
141+ uses : msys2/setup-msys2@v2
142+ if : " contains( matrix.config.goos, 'windows')"
143+ with :
144+ install : p7zip mingw-w64-x86_64-lua
145+
146+ - name : Set up TDM-GCC
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
148+ if : " contains( matrix.config.goarch, '386')"
149+ working-directory : ${{ github.workspace }}
150+
151+ - name : Set up Go
152+ uses : actions/setup-go@v5
153+ with :
154+ go-version-file : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/go.mod
155+ - run : go version
156+
157+ - name : Set up goversioninfo
158+ run : go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
159+ if : " contains( matrix.config.goos, 'windows')"
160+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
161+ env :
162+ GO111MODULE : on
163+ CGO_ENABLED : 1
164+ GOOS : ${{ matrix.config.goos }}
165+ GOPATH : ${{ github.workspace }}/go
166+ GOARCH : ${{ matrix.config.goarch }}
167+
168+ - name : Set up Node
169+ uses : actions/setup-node@v4
170+ with :
171+ node-version : 20
172+
173+ - name : Install Node pnpm
174+ run : npm install -g ${{ needs.create_release.outputs.packageManager }}
175+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
176+
177+ - name : Install Node Dependencies
178+ run : pnpm install --no-frozen-lockfile
179+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
180+
181+ - name : Building UI
182+ run : pnpm run build
183+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
184+
185+ - name : Remove Build Directory
186+ uses : JesseTG/rm@v1.0.2
187+ with :
188+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/build
189+
190+ - name : Remove Kernel Directory for Linux
191+ uses : JesseTG/rm@v1.0.2
192+ with :
193+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-linux
194+
195+ - name : Remove Kernel Directory for Windows
196+ uses : JesseTG/rm@v1.0.2
197+ with :
198+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel
199+
200+ - name : Remove Kernel Directory for macOS
201+ uses : JesseTG/rm@v1.0.2
202+ with :
203+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin
204+
205+ - name : Remove Kernel Directory for macOS ARM64
206+ uses : JesseTG/rm@v1.0.2
207+ with :
208+ path : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin-arm64
209+
210+ - name : Generate Icon Resource and Properties/Version Info For Windows
211+ run : ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
212+ if : " contains( matrix.config.goos, 'windows')"
213+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
214+
215+ - name : Building 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
218+ env :
219+ GO111MODULE : on
220+ CGO_ENABLED : 1
221+ GOOS : ${{ matrix.config.goos }}
222+ GOPATH : ${{ github.workspace }}/go
223+ GOARCH : ${{ matrix.config.goarch }}
224+
225+ - name : Building Electron
226+ run : pnpm run ${{ matrix.config.electron_args }}
227+ working-directory : ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
228+
229+ - name : Upload Release
230+ uses : actions/upload-release-asset@v1
231+ env :
232+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
233+ with :
234+ upload_url : ${{ needs.create_release.outputs.upload_url }}
235+ asset_name : siyuan-CE -${{ 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 }}
237+ asset_content_type : application/octet-stream
0 commit comments