ci: fix tag name

This commit is contained in:
Derek Wang 2025-03-29 17:23:36 -07:00
parent 1fdb575c7e
commit fc0715d8d9

View File

@ -2,6 +2,10 @@ name: Electron Build and Release
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
tag:
description: 'Tag for the release (e.g., v1.0.0). Leave empty if not applicable.'
required: false
push: push:
branches: branches:
- electron - electron
@ -83,8 +87,12 @@ jobs:
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: 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' }} 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 <tagname>", otherwise "Electron Release".
name: ${{ (github.event_name == 'push' && github.ref_type == 'tag') && format('Release {0}', github.ref_name) || 'Electron Release' }}
files: | files: |
dist/*.exe dist/*.exe
dist/*.dmg dist/*.dmg
@ -92,4 +100,4 @@ jobs:
dist/*.AppImage dist/*.AppImage
dist/*.zip dist/*.zip
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}