|
34 | 34 | run: uv build |
35 | 35 | - name: Lint and format code |
36 | 36 | run: | |
37 | | - uv run ruff check ./nmspy |
38 | | - uv run ruff format --check ./nmspy |
| 37 | + uv run ruff check ./nmspy ./example_mods |
| 38 | + uv run ruff format --check ./nmspy ./example_mods |
39 | 39 | uv run python -m twine check ./dist/* |
40 | 40 | - name: Upload Wheels |
41 | 41 | uses: actions/upload-artifact@v4 |
|
48 | 48 | - build_test |
49 | 49 | runs-on: ubuntu-latest |
50 | 50 | outputs: |
51 | | - should_release_pypi: ${{ steps.whether_to_release_pypi.outputs.should_release_pypi}} |
52 | | - should_release_test_pypi: ${{ steps.whether_to_release_test_pypi.outputs.should_release_pypi_test}} |
| 51 | + package_version: ${{ steps.set_version.outputs.package_version }} |
| 52 | + should_release_pypi: ${{ steps.whether_to_release_pypi.outputs.should_release_pypi }} |
| 53 | + should_release_test_pypi: ${{ steps.whether_to_release_test_pypi.outputs.should_release_pypi_test }} |
53 | 54 | permissions: |
54 | 55 | id-token: write # IMPORTANT: this permission is required to write to github envs |
55 | 56 | steps: |
|
63 | 64 | run: | |
64 | 65 | export PYPI_INDEX=test.pypi.org |
65 | 66 | ./.github/scripts/version_check.sh |
| 67 | + - name: Globalise determined version |
| 68 | + id: set_version |
| 69 | + run: echo "package_version=${{ env.PACKAGE_VERSION }}" >> "$GITHUB_OUTPUT" |
66 | 70 | - name: Assign whether to release to pypi to output |
67 | 71 | id: whether_to_release_pypi |
68 | 72 | run: echo "should_release_pypi=${{ env.PUBLISHING_pypi_org }}" >> "$GITHUB_OUTPUT" |
|
71 | 75 | run: echo "should_release_test_pypi=${{ env.PUBLISHING_test_pypi_org }}" >> "$GITHUB_OUTPUT" |
72 | 76 | release: |
73 | 77 | name: Release NMSpy wheels and source build to PyPI |
74 | | - # Only run this job if we merge into master, we need to do a release, and we don't specifically have some tag to skip publishing to pypi. |
75 | | - if: ${{ github.ref == 'refs/heads/master' && needs.release_check.outputs.should_release_pypi == 'true' && !startsWith(github.event.head_commit.message, '[skip pypi]') }} |
| 78 | + # Only run this job if the following conditions are met: |
| 79 | + # 1. We merge into master. |
| 80 | + # 2. We need to do a release. |
| 81 | + # 3. The commit message doesn't start with [skip pypi]. |
| 82 | + # 4. The version isn't a dev version. |
| 83 | + if: ${{ github.ref == 'refs/heads/master' && needs.release_check.outputs.should_release_pypi == 'true' && !startsWith(github.event.head_commit.message, '[skip pypi]') && !contains(needs.release_check.outputs.package_version, 'dev') }} |
76 | 84 | needs: |
77 | 85 | - build_test |
78 | 86 | - release_check |
|
0 commit comments