Skip to content

Commit 72fc6fe

Browse files
committed
ci: add manual build
1 parent 40c8d74 commit 72fc6fe

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/build-and-release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
tags:
66
- 'v*'
77
workflow_dispatch: # Allow manual trigger
8+
inputs:
9+
tag:
10+
description: 'Tag for release (e.g., v1.0.0)'
11+
required: true
12+
default: v4.0.0
813

914
jobs:
1015
build:
@@ -50,11 +55,12 @@ jobs:
5055
run: pnpm run build:${{ matrix.platform }}
5156
env:
5257
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
TAG: ${{ github.ref_name || inputs.tag }}
5359

5460
- name: Upload artifacts
5561
uses: actions/upload-artifact@v4
5662
with:
57-
name: masscode-${{ matrix.platform }}-${{ github.ref_name }}
63+
name: masscode-${{ matrix.platform }}-${{ env.TAG }}
5864
path: |
5965
dist/*.dmg
6066
dist/*.pkg
@@ -69,7 +75,7 @@ jobs:
6975
name: Create Release
7076
needs: build
7177
runs-on: ubuntu-latest
72-
if: startsWith(github.ref, 'refs/tags/v')
78+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
7379

7480
steps:
7581
- name: Checkout code
@@ -94,6 +100,7 @@ jobs:
94100
with:
95101
files: |
96102
artifacts/masscode-*/*
103+
tag_name: ${{ github.ref_name || inputs.tag }}
97104
draft: true
98105
generate_release_notes: true
99106
append_body: true

0 commit comments

Comments
 (0)