From 2dc3961ae8983363ace7f5b85cda59e470e275d3 Mon Sep 17 00:00:00 2001 From: Derek Wang Date: Sat, 29 Mar 2025 16:31:42 -0700 Subject: [PATCH 1/3] ci: name release and only draft for branch build --- .github/workflows/electron.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 7517f6c..2403ebb 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -83,7 +83,8 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v2 with: - draft: ${{ github.event_name == 'workflow_dispatch' || github.ref_type == 'branch' }} + draft: ${{ github.ref_type == 'branch' }} + name: ${{ github.ref_type == 'tag' && format('Release {0}', github.ref_name) || 'Electron Release' }} files: | dist/*.exe dist/*.dmg From 1fdb575c7e1f369bbd5d5fef90e744264f9fd4b8 Mon Sep 17 00:00:00 2001 From: Derek Wang Date: Sat, 29 Mar 2025 17:08:33 -0700 Subject: [PATCH 2/3] ci: fix logic, only draft for branch build --- .github/workflows/electron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 2403ebb..148f9a7 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -83,7 +83,7 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v2 with: - draft: ${{ github.ref_type == 'branch' }} + draft: ${{ github.event_name != 'workflow_dispatch' && github.ref_type == 'branch' }} name: ${{ github.ref_type == 'tag' && format('Release {0}', github.ref_name) || 'Electron Release' }} files: | dist/*.exe From fc0715d8d937f6a04efde1914be78d701eb7d631 Mon Sep 17 00:00:00 2001 From: Derek Wang Date: Sat, 29 Mar 2025 17:23:36 -0700 Subject: [PATCH 3/3] ci: fix tag name --- .github/workflows/electron.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 148f9a7..19cc46b 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -2,6 +2,10 @@ name: Electron Build and Release on: workflow_dispatch: + inputs: + tag: + description: 'Tag for the release (e.g., v1.0.0). Leave empty if not applicable.' + required: false push: branches: - electron @@ -83,8 +87,12 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v2 with: + # Use the workflow_dispatch input tag if available, else use the Git ref name. + tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }} + # Only branch pushes remain drafts. For workflow_dispatch and tag pushes the release is published. draft: ${{ github.event_name != 'workflow_dispatch' && github.ref_type == 'branch' }} - name: ${{ github.ref_type == 'tag' && format('Release {0}', github.ref_name) || 'Electron Release' }} + # For tag pushes, name the release as "Release ", otherwise "Electron Release". + name: ${{ (github.event_name == 'push' && github.ref_type == 'tag') && format('Release {0}', github.ref_name) || 'Electron Release' }} files: | dist/*.exe dist/*.dmg @@ -92,4 +100,4 @@ jobs: dist/*.AppImage dist/*.zip env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file