File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments