Skip to content

Commit 582c1fc

Browse files
committed
fix(ci): correctly extract version in test-publish job
1 parent 6ef2fca commit 582c1fc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/ci-cd.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,11 @@ jobs:
6565
# Required for installation of the test package in the
6666
# next job.
6767
outputs:
68-
version: ${{ steps.extract_version.outputs.version }}
68+
version: ${{ steps.get_version.outputs.version }}
6969

7070
steps:
7171
- uses: actions/checkout@v3
7272

73-
- name: Remember version
74-
id: extract_version
75-
run: |
76-
VERSION=$(cat pyproject.toml | grep -oE -m 1 "version = \"(.*)\"" | cut -f2 -d '"')
77-
echo "Version: ${VERSION}"
78-
echo "version=${VERSION}" >> $GITHUB_OUTPUT
79-
8073
# For publishing any version will do
8174
- name: Set up Python 3.11
8275
uses: actions/setup-python@v4
@@ -103,6 +96,12 @@ jobs:
10396
- name: Build packages for release
10497
run: ./bin/task build
10598

99+
- name: Get package version
100+
id: get_version
101+
run: |
102+
VERSION=$(basename dist/*.whl | cut -d- -f2)
103+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
104+
106105
- name: Publish distribution to Test PyPI
107106
env:
108107
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)