@@ -3,6 +3,11 @@ name: Build with architecture
33on :
44 workflow_dispatch :
55 inputs :
6+ tag_name :
7+ description : ' Tag name to build'
8+ required : false
9+ default : ' preview'
10+ type : string
611 publish_enabled :
712 description : ' Publish artifacts after build?'
813 required : true
3439 - ubuntu-24.04-arm-arm64-rpm
3540 - All
3641permissions :
37- contents : read
42+ contents : write
3843
3944env :
4045 ELECTRON_OUTPUT_PATH : ./dist_electron
@@ -154,10 +159,7 @@ jobs:
154159 yarn global add xvfb-maybe
155160 if [[ "${{ matrix.format }}" == "zip" || "${{ matrix.format }}" == "7z" ]]; then
156161 echo "Target format is ${{ matrix.format }}, downloading all resources..."
157- yarn run prepare
158- else
159- echo "Target format is other, downloading themes only..."
160- yarn run prepare:themes
162+ yarn run prepare:7za
161163 fi
162164 echo "Checking resources directory:"
163165 ls -alh ./resources/theme || echo "Theme directory not found"
@@ -168,22 +170,6 @@ jobs:
168170 echo "❌ 7za.exe does not exist"
169171 fi
170172
171- - name : Generate release notes
172- if : github.event.inputs.build_os == matrix.filter || github.event.inputs.build_os == 'All'
173- shell : bash
174- run : |
175- chmod +x ./scripts/generate-release-notes.sh
176- ./scripts/generate-release-notes.sh
177-
178- - name : Configure electron-builder.json
179- if : github.event.inputs.build_os == matrix.filter || github.event.inputs.build_os == 'All'
180- shell : bash
181- run : |
182- # Remove publish config if not publishing
183- if [ "${{ github.event.inputs.publish_enabled }}" == "false" ]; then
184- jq 'del(.publish)' electron-builder.json > tmp.json && mv tmp.json electron-builder.json
185- fi
186-
187173 - name : Build & release app
188174 if : github.event.inputs.build_os == matrix.filter || github.event.inputs.build_os == 'All'
189175 shell : bash
@@ -192,29 +178,19 @@ jobs:
192178 export CSC_IDENTITY_AUTO_DISCOVERY=false
193179 unset CSC_LINK WIN_CSC_LINK CSC_KEY_PASSWORD
194180 fi
195- PUBLISH_ARG="never"
196- if [ "${{ github.event.inputs.publish_enabled }}" == "true" ]; then
197- PUBLISH_ARG="always"
198- fi
199- echo "Publishing argument: $PUBLISH_ARG"
200181 if [[ "${{ matrix.os }}" == windows* ]]; then
201- yarn run build:win ${{ matrix.format}} --${{ matrix.arch }} --publish $PUBLISH_ARG
182+ yarn run build:win ${{ matrix.format}} --${{ matrix.arch }} --publish never
202183 elif [[ "${{ matrix.os }}" == macos* ]]; then
203- yarn run build:mac ${{ matrix.format}} --${{ matrix.arch }} --publish $PUBLISH_ARG
184+ yarn run build:mac ${{ matrix.format}} --${{ matrix.arch }} --publish never
204185 elif [[ "${{ matrix.os }}" == ubuntu* ]]; then
205- yarn run build:linux ${{ matrix.format}} --${{ matrix.arch }} --publish $PUBLISH_ARG
186+ yarn run build:linux ${{ matrix.format}} --${{ matrix.arch }} --publish never
206187 else
207188 echo "Unsupported OS: ${{ matrix.os }}"
208189 exit 1
209190 fi
210191 env :
211192 USE_SYSTEM_FPM : ${{ matrix.os == 'ubuntu-24.04-arm' && 'true' || 'false' }}
212193 GH_TOKEN : ${{ secrets.GH_TOKEN }}
213- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
214- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
215- R2_SECRET_ID : ${{ secrets.R2_SECRET_ID }}
216- R2_SECRET_KEY : ${{ secrets.R2_SECRET_KEY }}
217- R2_ACCOUNT_ID : ${{ secrets.R2_ACCOUNT_ID }}
218194 ELECTRON_SKIP_NOTARIZATION : ${{ secrets.ELECTRON_SKIP_NOTARIZATION }}
219195 XCODE_APP_LOADER_EMAIL : ${{ secrets.XCODE_APP_LOADER_EMAIL }}
220196 XCODE_APP_LOADER_PASSWORD : ${{ secrets.XCODE_APP_LOADER_PASSWORD }}
@@ -250,3 +226,99 @@ jobs:
250226 path : dist_electron/**/*.yml
251227 retention-days : 30
252228 if-no-files-found : ' ignore'
229+
230+ combine-and-upload :
231+ name : Combine and Upload Release
232+ needs : build
233+ runs-on : ubuntu-latest
234+
235+ steps :
236+ - name : Check out git repository
237+ uses : actions/checkout@v6
238+
239+ - name : Install Node.js
240+ uses : actions/setup-node@v6
241+ with :
242+ node-version : " 22.x"
243+
244+ - name : Install dependencies
245+ shell : bash
246+ run : |
247+ yarn config set ignore-engines true
248+ rm -rf node_modules && yarn install
249+
250+ - name : Generate Release Notes
251+ run : |
252+ chmod +x ./scripts/generate-release-notes.sh
253+ ./scripts/generate-release-notes.sh
254+
255+ - name : Download All Artifacts
256+ uses : actions/download-artifact@v4
257+ with :
258+ pattern : ' *-artifacts'
259+ path : ./artifacts
260+
261+ - name : Download YML Artifacts
262+ uses : actions/download-artifact@v4
263+ with :
264+ pattern : ' *-yml'
265+ path : ./yml-artifacts
266+ merge-multiple : false
267+
268+ - name : List downloaded artifacts
269+ run : |
270+ echo "Downloaded artifacts structure:"
271+ find ./yml-artifacts -type f -name "*.yml"
272+ tree ./yml-artifacts
273+ tree ./artifacts
274+
275+ - name : Combine and deduplicate yml files
276+ run : |
277+ node scripts/combine-yml.cjs ./yml-artifacts ./dist_electron/combined
278+ echo "Combined YML files:"
279+ ls -la ./dist_electron/combined/
280+ echo "Latest combined YML content:"
281+ cat ./dist_electron/combined/latest.yml
282+ echo "Latest macOS combined YML content:"
283+ cat ./dist_electron/combined/latest-mac.yml
284+ echo "Latest linux combined YML content:"
285+ cat ./dist_electron/combined/latest-linux.yml
286+ echo "Latest linux ARM64 combined YML content:"
287+ cat ./dist_electron/combined/latest-linux-arm64.yml
288+
289+ - name : Publish GitHub Dev Release
290+ uses : softprops/action-gh-release@v2
291+ continue-on-error : true
292+ with :
293+ token : ${{ secrets.GH_TOKEN }}
294+ tag_name : ${{ github.event.inputs.tag_name }}
295+ draft : true
296+ prerelease : ${{ github.event.inputs.publish_enabled == 'false' || github.event.inputs.tag_name == 'preview' }}
297+ body_path : ./release-notes.md
298+ name : ${{ github.event.inputs.tag_name }}
299+ files : |
300+ !artifacts/**/*-unpacked/**
301+ artifacts/**/*.exe
302+ artifacts/**/*.dmg
303+ artifacts/**/*.zip
304+ artifacts/**/*.7z
305+ artifacts/**/*.AppImage
306+ artifacts/**/*.deb
307+ artifacts/**/*.snap
308+ artifacts/**/*.rpm
309+ ./dist_electron/combined/*.yml
310+ artifacts/**/*.tar.gz
311+
312+ - name : Upload to S3
313+ run : |
314+ if [ "${{ github.event.inputs.publish_enabled }}" == "false" ]; then
315+ echo "Publishing is disabled. Skipping upload to S3."
316+ node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined
317+ exit 0
318+ fi
319+ node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined false
320+ env :
321+ R2_SECRET_ID : ${{ secrets.R2_SECRET_ID }}
322+ R2_SECRET_KEY : ${{ secrets.R2_SECRET_KEY }}
323+ R2_ACCOUNT_ID : ${{ secrets.R2_ACCOUNT_ID }}
324+
0 commit comments