Skip to content

Commit

Permalink
ci: fix versioning; enable publishing (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjchambers authored Aug 21, 2023
1 parent 1752793 commit 95e8cc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/ci_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ jobs:
path: ${{ github.workspace }}/python/docs/_build

version:
# Build wheels in the merge queue (to verify they build) and during release.
if: |
github.event_name == 'merge_group' ||
github.event_name == 'release'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
Expand All @@ -159,17 +155,17 @@ jobs:
- name: Determine version (merge)
run: |
pip install tomlkit
VERSION=$(python ../scripts/get_version.py path_to_toml_file.toml path.within.toml)
VERSION=$(python ../scripts/get_version.py pyproject.toml project.version)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Determine version (release)
if: github.event_name == 'release'
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set version
id: set-version
run: |
echo VERSION=$VERSION
echo "::set-output name=version::$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
build-wheel-macos:
Expand Down Expand Up @@ -436,7 +432,6 @@ jobs:
name: artifact
path: dist

# - uses: pypa/gh-action-pypi-publish@release/v1
# To Test
#with:
# To test: repository_url: https://test.pypi.org/legacy/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion scripts/get_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def main():

toml_path = args.path.split('.')
value = get_value_from_toml(args.file, toml_path)
print(f"Value at '{args.path}' in '{args.file}': {value}")
print(f"{value}")

if __name__ == "__main__":
main()

0 comments on commit 95e8cc8

Please sign in to comment.