Skip to content

Commit e9a88be

Browse files
committed
Add a dispatch to the release pipeline
Signed-off-by: fortmarek <[email protected]>
1 parent d15af5f commit e9a88be

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: release_binaries
22
on:
33
release:
44
types: created
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'Release tag (e.g., v0.2.40)'
9+
required: true
10+
type: string
511

612
jobs:
713
macOS:
@@ -15,7 +21,12 @@ jobs:
1521
- name: Checkout
1622
uses: actions/checkout@v1
1723
- name: Set tag name
18-
run: echo "TAG_NAME=$(echo $GITHUB_REF | cut -c 11-)" >> $GITHUB_ENV
24+
run: |
25+
if [ -n "${{ inputs.tag }}" ]; then
26+
echo "TAG_NAME=${{ inputs.tag }}" >> $GITHUB_ENV
27+
else
28+
echo "TAG_NAME=$(echo $GITHUB_REF | cut -c 11-)" >> $GITHUB_ENV
29+
fi
1930
- name: Build x86_64-apple-macosx
2031
run: rake 'build[release, x86_64-apple-macosx]'
2132
- name: Zip x86_64-apple-macosx release
@@ -38,7 +49,7 @@ jobs:
3849
repo_token: ${{ secrets.GITHUB_TOKEN }}
3950
file: releases/*
4051
file_glob: true
41-
tag: ${{ github.ref }}
52+
tag: ${{ inputs.tag || github.ref }}
4253
overwrite: true
4354

4455
linux:
@@ -54,7 +65,12 @@ jobs:
5465
- name: Build
5566
run: LANG=en_US.UTF-8 LC_CTYPE=UTF-8 rake build[release]
5667
- name: Set tag name
57-
run: echo "TAG_NAME=$(echo $GITHUB_REF | cut -c 11-)" >> $GITHUB_ENV
68+
run: |
69+
if [ -n "${{ inputs.tag }}" ]; then
70+
echo "TAG_NAME=${{ inputs.tag }}" >> $GITHUB_ENV
71+
else
72+
echo "TAG_NAME=$(echo $GITHUB_REF | cut -c 11-)" >> $GITHUB_ENV
73+
fi
5874
- name: Zip release
5975
uses: montudor/[email protected]
6076
with:
@@ -67,5 +83,5 @@ jobs:
6783
repo_token: ${{ secrets.GITHUB_TOKEN }}
6884
file: releases/*
6985
file_glob: true
70-
tag: ${{ github.ref }}
86+
tag: ${{ inputs.tag || github.ref }}
7187
overwrite: true

0 commit comments

Comments
 (0)