Skip to content

Commit 8d33adc

Browse files
Add tag input to workflow_dispatch for manual releases
When manually triggering the release workflow, a tag input is now required (e.g. v0.23.0). All checkout steps use this tag as the ref, and Docker metadata uses it for proper image tagging. When triggered by a tag push, the behavior is unchanged (falls back to github.ref). Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
1 parent 02d72e5 commit 8d33adc

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Release package
22
on:
33
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: "Tag to release (e.g. v0.23.0)"
7+
required: true
8+
type: string
49
push:
510
tags:
611
- v[0-9].[0-9]+.[0-9]+
@@ -15,6 +20,8 @@ jobs:
1520
steps:
1621
- name: Checkout Elementary
1722
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ inputs.tag || github.ref }}
1825

1926
- name: Setup Python
2027
uses: actions/setup-python@v5
@@ -64,6 +71,8 @@ jobs:
6471
steps:
6572
- name: Checkout Elementary
6673
uses: actions/checkout@v4
74+
with:
75+
ref: ${{ inputs.tag || github.ref }}
6776

6877
- name: Setup Python
6978
uses: actions/setup-python@v5
@@ -98,6 +107,8 @@ jobs:
98107
steps:
99108
- name: Checkout Elementary
100109
uses: actions/checkout@v4
110+
with:
111+
ref: ${{ inputs.tag || github.ref }}
101112

102113
- name: Set up QEMU for multi-platform support
103114
uses: docker/setup-qemu-action@v3
@@ -117,6 +128,9 @@ jobs:
117128
uses: docker/metadata-action@v4
118129
with:
119130
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
131+
tags: |
132+
type=semver,pattern={{version}},value=${{ inputs.tag || '' }}
133+
type=ref,event=tag
120134
121135
- name: Build and push Docker image
122136
uses: docker/build-push-action@v3
@@ -132,6 +146,8 @@ jobs:
132146
runs-on: ubuntu-latest
133147
steps:
134148
- uses: actions/checkout@v4
149+
with:
150+
ref: ${{ inputs.tag || github.ref }}
135151
- name: PR master to docs
136152
uses: repo-sync/pull-request@v2
137153
with:

0 commit comments

Comments
 (0)