diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8fe6d11..9db5500 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,7 @@ name: Release +run-name: Release from ${{ github.ref }} + on: [ workflow_dispatch ] jobs: @@ -20,6 +22,12 @@ jobs: name: dist-release path: dist +# # Allow the same distribution version to be test-published multiple times. +# # Useful for prototyping the release process. +# - name: Rename wheels with build number +# # language=sh +# run: for file in dist/*.whl; do mv "$file" "${file//py3/${{ github.run_number }}-py3}"; done + - name: Publish distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -43,30 +51,33 @@ jobs: - name: Install distribution from TestPyPI # language=sh - run: pip install --no-deps -i https://test.pypi.org/simple/ 6s-bin + run: pip install --pre --no-deps -i https://test.pypi.org/simple/ 6s-bin - name: Install dependencies from PyPI if: ${{ !contains(matrix.os, 'windows') }} # language=sh run: | - python -m pip install '6s-bin[wrapper]' | tee /dev/tty | grep 'Requirement already satisfied: 6s-bin' > /dev/null + python -m pip install '6s-bin[wrapper]' packaging | tee /dev/tty | grep 'Requirement already satisfied: 6s-bin' > /dev/null - name: Install dependencies from PyPI (Windows) if: ${{ contains(matrix.os, 'windows') }} # language=sh run: | - $output = python -m pip install '6s-bin[wrapper]' | Out-String + $output = python -m pip install '6s-bin[wrapper]' packaging | Out-String Write-Host $output exit [int]$($output -notmatch 'Requirement already satisfied: 6s-bin') - name: Verify that installed distribution version matches tag + # TODO find fix for double-quotes being stripped when the below command is run in PowerShell. + if: ${{ !contains(matrix.os, 'windows') }} # language=sh run: > - python -c 'import sixs_bin; - expected_ref = f"refs/tags/v{sixs_bin.__version__}"; - actual_ref="${{ github.ref }}"; - print(f"{expected_ref=} {actual_ref=}"); - assert expected_ref == actual_ref + python -c 'import packaging.version; + import sixs_bin; + installed_version = packaging.version.parse(sixs_bin.__version__); + expected_version = packaging.version.parse("${{ github.ref }}".split("/")[-1].removeprefix("v")); + print(f"{installed_version=} {expected_version=}"); + assert installed_version.release == expected_version.release ' - name: Run wrapper test diff --git a/pyproject.toml b/pyproject.toml index 7451bed..f3956a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "6s-bin" -version = "0.10.0-dev" +version = "0.11.0-dev" description = "Compiled binaries for the 6S Radiative Transfer Model exposed as package resources." license = "Apache-2.0" authors = ["Brian Schubert "]