From fc0715d8d937f6a04efde1914be78d701eb7d631 Mon Sep 17 00:00:00 2001 From: Derek Wang Date: Sat, 29 Mar 2025 17:23:36 -0700 Subject: [PATCH] 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 148f9a75..19cc46be 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