Skip to content

Commit 77a00a4

Browse files
committed
version input in the Deploy workflow for TestPyPI
1 parent 4e70031 commit 77a00a4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: Build & Deploy to PyPI
33
on:
44
workflow_dispatch:
55
inputs:
6-
note:
7-
description: 'This workflow publishes to TestPyPI only. For production, create a GitHub Release.'
8-
required: false
9-
default: ""
6+
version:
7+
description: Enter package version for TestPyPI only. For production, create a GitHub Release.
8+
required: true
109

1110
release:
1211
types: [published]
@@ -37,12 +36,12 @@ jobs:
3736
run: |
3837
uv run pytest tests
3938
40-
- name: Version replacement based on tag ↔️
41-
if: github.ref_type == 'tag'
39+
- name: Version replacement based on workflow input or release tag ↔️
40+
if: inputs.version || github.ref_type == 'tag'
4241
run: |
43-
TAG_VERSION=${GITHUB_REF#refs/tags/}
44-
echo "Tag version: $TAG_VERSION"
45-
uv version $TAG_VERSION
42+
VERSION="${{ inputs.version || github.ref_name }}"
43+
echo "Setting version: $VERSION"
44+
uv version $VERSION
4645
4746
- name: Build package 📦
4847
run: |

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "keboola.component"
3-
version = "1.9.0" # replaced by the actual version based on the release tag in github actions
3+
version = "0.0.0" # replaced by the actual version based on the release tag in github actions
44
dependencies = [
55
"pygelf",
66
"deprecated",

0 commit comments

Comments
 (0)