Skip to content

Commit ec5b5ad

Browse files
committed
feat: implement repository_dispatch for automated desktop builds
- Add desktop build trigger to release workflow when new release is published - Switch desktop-build workflow from release events to repository_dispatch - Include clean file filtering to only attach installer files (Setup.exe, .dmg, .AppImage) - Pass version info through client payload for accurate release targeting - This enables automatic desktop builds after successful web app releases
1 parent 7638db7 commit ec5b5ad

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/desktop-build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Desktop Build
22

33
on:
4-
release:
5-
types: [published]
4+
repository_dispatch:
5+
types: [desktop-build]
66
workflow_dispatch:
77

88
permissions:
@@ -72,14 +72,13 @@ jobs:
7272
name: Attach Desktop Assets
7373
needs: build-desktop
7474
runs-on: ubuntu-latest
75-
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
7675

7776
steps:
7877
- name: Get latest release tag
7978
id: latest_release
8079
run: |
81-
if [ "${{ github.event_name }}" = "release" ]; then
82-
echo "tag_name=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
80+
if [ "${{ github.event_name }}" = "repository_dispatch" ] && [ -n "${{ github.event.client_payload.version }}" ]; then
81+
echo "tag_name=v${{ github.event.client_payload.version }}" >> $GITHUB_OUTPUT
8382
else
8483
# Get latest release tag for manual trigger
8584
TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')
@@ -99,7 +98,7 @@ jobs:
9998
with:
10099
tag_name: ${{ steps.latest_release.outputs.tag_name }}
101100
files: |
102-
release-artifacts/**/*.exe
101+
release-artifacts/**/*Setup*.exe
103102
release-artifacts/**/*.dmg
104103
release-artifacts/**/*.AppImage
105104
env:

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,11 @@ jobs:
7575
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7676
run: npx semantic-release
7777

78+
- name: Trigger Desktop Build
79+
if: steps.semantic.outputs.new_release_published == 'true'
80+
uses: peter-evans/repository-dispatch@v2
81+
with:
82+
token: ${{ secrets.GITHUB_TOKEN }}
83+
event-type: desktop-build
84+
client-payload: '{"version": "${{ steps.semantic.outputs.new_release_version }}"}'
85+

0 commit comments

Comments
 (0)