Skip to content

Commit

Permalink
Correct sharing of version number across jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Sep 30, 2024
1 parent 61fc15f commit b0751ff
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Get new version number
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
new_version: ${{ steps.get_version.outputs.new_version }}
steps:
- uses: actions/checkout@v4

Expand All @@ -37,7 +37,7 @@ jobs:

- name: Install Hatch
shell: bash
run: python -m pip install --disable-pip-version-check --upgrade hatch hatchling
run: python -m pip install --disable-pip-version-check --upgrade hatch

- name: Bump version
id: get_version
Expand All @@ -56,7 +56,7 @@ jobs:
hatch version "${version_bump_rule}"
export new_version=$(TERM="unknown" hatch version)
echo "new_version: '${new_version}'"
echo "new_version=${new_version}" >> $GITHUB_ENV # Save env variable for later steps
echo "new_version=${new_version}" >> "$GITHUB_OUTPUT" # Save variable for later steps
build_wheels:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Update versions
shell: bash
run: |
export new_version=${{needs.get_new_version.outputs.version}}
export new_version=${{needs.get_new_version.outputs.new_version}}
echo "Updating version to '${new_version}'"
python .github/scripts/update_versions.py
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Update versions
shell: bash
run: |
export new_version=${{needs.get_new_version.outputs.version}}
export new_version=${{needs.get_new_version.outputs.new_version}}
echo "Updating version to '${new_version}'"
python .github/scripts/update_versions.py
Expand Down Expand Up @@ -201,14 +201,14 @@ jobs:
- name: Update versions
shell: bash
run: |
export new_version=${{needs.get_new_version.outputs.version}}
export new_version=${{needs.get_new_version.outputs.new_version}}
echo "Updating version to '${new_version}'"
python .github/scripts/update_versions.py
- name: Tag and push new version
shell: bash
run: |
export new_version=${{needs.get_new_version.outputs.version}}
export new_version=${{needs.get_new_version.outputs.new_version}}
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "Update version for new release" pyproject.toml setup.py src/quaternion/__init__.py
Expand All @@ -223,8 +223,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.get_new_version.outputs.version }}
name: Release v${{ needs.get_new_version.outputs.version }}
tag_name: v${{ needs.get_new_version.outputs.new_version }}
name: Release v${{ needs.get_new_version.outputs.new_version }}
draft: false
prerelease: false

Expand Down

0 comments on commit b0751ff

Please sign in to comment.