Skip to content

Commit f58942d

Browse files
committed
updated script again to be clearer
1 parent 2d1afe8 commit f58942d

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ jobs:
2121
name: Parse the semantic version from the release
2222
runs-on: ubuntu-latest
2323
steps:
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Install packaging
30+
run: pip install packaging
31+
2432
- name: Parse semver string
2533
id: semver_parser
34+
env:
35+
RAW_TAG: "v3.0.0a1"
36+
# RAW_TAG: ${{ github.event.release.tag_name }}
2637
run: |
27-
echo "VERSION_RAW=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
28-
pip install packaging
29-
echo "VERSION=$(python -c 'from packaging.version import Version; print(str(Version("${GITHUB_REF#refs/tags/v}")))')" >> $GITHUB_ENV
30-
echo "::set-output name=version::${VERSION}"
38+
VERSION="${RAW_TAG#v}"
39+
echo "Detected version: $VERSION"
40+
echo "::set-output name=version::$(python -c "from packaging.version import Version; print(Version('$VERSION'))")"
3141
outputs:
3242
semver: "${{ steps.semver_parser.outputs.version }}"
3343

0 commit comments

Comments
 (0)