|
57 | 57 | - name: Setup Node.js |
58 | 58 | uses: actions/setup-node@v6 |
59 | 59 | with: |
60 | | - node-version: 20 |
| 60 | + node-version: '24.13.0' |
61 | 61 | cache: "pnpm" |
62 | 62 | cache-dependency-path: dashboard/pnpm-lock.yaml |
63 | 63 |
|
@@ -102,170 +102,11 @@ jobs: |
102 | 102 | cp "dashboard/AstrBot-${VERSION_TAG}-dashboard.zip" "dashboard/astrbot-webui-${VERSION_TAG}.zip" |
103 | 103 | rclone copy "dashboard/astrbot-webui-${VERSION_TAG}.zip" "r2:${R2_BUCKET_NAME}" --progress |
104 | 104 |
|
105 | | - build-desktop: |
106 | | - name: Build ${{ matrix.name }} |
107 | | - runs-on: ${{ matrix.runner }} |
108 | | - strategy: |
109 | | - fail-fast: false |
110 | | - matrix: |
111 | | - include: |
112 | | - - name: linux-x64 |
113 | | - runner: ubuntu-24.04 |
114 | | - os: linux |
115 | | - arch: amd64 |
116 | | - - name: linux-arm64 |
117 | | - runner: ubuntu-24.04-arm |
118 | | - os: linux |
119 | | - arch: arm64 |
120 | | - - name: windows-x64 |
121 | | - runner: windows-2022 |
122 | | - os: win |
123 | | - arch: amd64 |
124 | | - - name: windows-arm64 |
125 | | - runner: windows-11-arm |
126 | | - os: win |
127 | | - arch: arm64 |
128 | | - - name: macos-x64 |
129 | | - runner: macos-15-intel |
130 | | - os: mac |
131 | | - arch: amd64 |
132 | | - - name: macos-arm64 |
133 | | - runner: macos-15 |
134 | | - os: mac |
135 | | - arch: arm64 |
136 | | - env: |
137 | | - CSC_IDENTITY_AUTO_DISCOVERY: "false" |
138 | | - steps: |
139 | | - - name: Checkout repository |
140 | | - uses: actions/checkout@v6 |
141 | | - with: |
142 | | - fetch-depth: 0 |
143 | | - ref: ${{ inputs.ref || github.ref }} |
144 | | - |
145 | | - - name: Resolve tag |
146 | | - id: tag |
147 | | - shell: bash |
148 | | - run: | |
149 | | - if [ "${{ github.event_name }}" = "push" ]; then |
150 | | - tag="${GITHUB_REF_NAME}" |
151 | | - elif [ -n "${{ inputs.tag }}" ]; then |
152 | | - tag="${{ inputs.tag }}" |
153 | | - else |
154 | | - tag="$(git describe --tags --abbrev=0)" |
155 | | - fi |
156 | | - if [ -z "$tag" ]; then |
157 | | - echo "Failed to resolve tag." >&2 |
158 | | - exit 1 |
159 | | - fi |
160 | | - echo "tag=$tag" >> "$GITHUB_OUTPUT" |
161 | | -
|
162 | | - - name: Setup uv |
163 | | - uses: astral-sh/setup-uv@v7 |
164 | | - |
165 | | - - name: Setup Python |
166 | | - uses: actions/setup-python@v6 |
167 | | - with: |
168 | | - python-version: "3.12" |
169 | | - |
170 | | - - name: Setup pnpm |
171 | | - uses: pnpm/action-setup@v4 |
172 | | - with: |
173 | | - version: 10.28.2 |
174 | | - |
175 | | - - name: Setup Node.js |
176 | | - uses: actions/setup-node@v6 |
177 | | - with: |
178 | | - node-version: 20 |
179 | | - cache: "pnpm" |
180 | | - cache-dependency-path: | |
181 | | - dashboard/pnpm-lock.yaml |
182 | | - desktop/pnpm-lock.yaml |
183 | | -
|
184 | | - - name: Prepare OpenSSL for Windows ARM64 |
185 | | - if: ${{ matrix.os == 'win' && matrix.arch == 'arm64' }} |
186 | | - shell: pwsh |
187 | | - run: | |
188 | | - git clone https://github.com/microsoft/vcpkg.git C:\vcpkg |
189 | | - & C:\vcpkg\bootstrap-vcpkg.bat -disableMetrics |
190 | | - & C:\vcpkg\vcpkg.exe install openssl:arm64-windows |
191 | | -
|
192 | | - "VCPKG_ROOT=C:\vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
193 | | - "VCPKGRS_TRIPLET=arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
194 | | - "OPENSSL_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
195 | | - "OPENSSL_ROOT_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
196 | | - "OPENSSL_LIB_DIR=C:\vcpkg\installed\arm64-windows\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
197 | | - "OPENSSL_INCLUDE_DIR=C:\vcpkg\installed\arm64-windows\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
198 | | -
|
199 | | - - name: Install dependencies |
200 | | - shell: bash |
201 | | - run: | |
202 | | - uv sync |
203 | | - pnpm --dir dashboard install --frozen-lockfile |
204 | | - pnpm --dir desktop install --frozen-lockfile |
205 | | -
|
206 | | - - name: Build desktop package |
207 | | - shell: bash |
208 | | - run: | |
209 | | - pnpm --dir dashboard run build |
210 | | - pnpm --dir desktop run build:webui |
211 | | - pnpm --dir desktop run build:backend |
212 | | - pnpm --dir desktop run sync:version |
213 | | - pnpm --dir desktop exec electron-builder --publish never |
214 | | -
|
215 | | - - name: Normalize artifact names |
216 | | - shell: bash |
217 | | - env: |
218 | | - NAME_PREFIX: AstrBot-${{ steps.tag.outputs.tag }}-${{ matrix.arch }}-${{ matrix.os }} |
219 | | - run: | |
220 | | - shopt -s nullglob |
221 | | - out_dir="desktop/dist/release" |
222 | | - mkdir -p "$out_dir" |
223 | | - files=( |
224 | | - desktop/dist/*.AppImage |
225 | | - desktop/dist/*.dmg |
226 | | - desktop/dist/*.zip |
227 | | - desktop/dist/*.exe |
228 | | - ) |
229 | | - if [ ${#files[@]} -eq 0 ]; then |
230 | | - echo "No desktop artifacts found to rename." >&2 |
231 | | - exit 1 |
232 | | - fi |
233 | | - for src in "${files[@]}"; do |
234 | | - file="$(basename "$src")" |
235 | | - case "$file" in |
236 | | - *.AppImage) |
237 | | - dest="$out_dir/${NAME_PREFIX}.AppImage" |
238 | | - ;; |
239 | | - *.dmg) |
240 | | - dest="$out_dir/${NAME_PREFIX}.dmg" |
241 | | - ;; |
242 | | - *.exe) |
243 | | - dest="$out_dir/${NAME_PREFIX}.exe" |
244 | | - ;; |
245 | | - *.zip) |
246 | | - dest="$out_dir/${NAME_PREFIX}.zip" |
247 | | - ;; |
248 | | - *) |
249 | | - continue |
250 | | - ;; |
251 | | - esac |
252 | | - cp "$src" "$dest" |
253 | | - done |
254 | | - ls -la "$out_dir" |
255 | | -
|
256 | | - - name: Upload desktop artifacts |
257 | | - uses: actions/upload-artifact@v6 |
258 | | - with: |
259 | | - name: AstrBot-${{ steps.tag.outputs.tag }}-${{ matrix.arch }}-${{ matrix.os }} |
260 | | - if-no-files-found: error |
261 | | - path: desktop/dist/release/* |
262 | | - |
263 | 105 | publish-release: |
264 | 106 | name: Publish GitHub Release |
265 | 107 | runs-on: ubuntu-24.04 |
266 | 108 | needs: |
267 | 109 | - build-dashboard |
268 | | - - build-desktop |
269 | 110 | steps: |
270 | 111 | - name: Checkout repository |
271 | 112 | uses: actions/checkout@v6 |
@@ -296,12 +137,6 @@ jobs: |
296 | 137 | name: Dashboard-${{ steps.tag.outputs.tag }} |
297 | 138 | path: release-assets |
298 | 139 |
|
299 | | - - name: Download desktop artifacts |
300 | | - uses: actions/download-artifact@v7 |
301 | | - with: |
302 | | - pattern: AstrBot-${{ steps.tag.outputs.tag }}-* |
303 | | - path: release-assets |
304 | | - merge-multiple: true |
305 | 140 |
|
306 | 141 | - name: Resolve release notes |
307 | 142 | id: notes |
|
0 commit comments