|
16 | 16 | runs-on: ubuntu-latest |
17 | 17 | environment: release |
18 | 18 | outputs: |
19 | | - released: ${{ steps.release.outputs.released }} |
20 | | - tag: ${{ steps.release.outputs.tag }} |
| 19 | + released: ${{ steps.semantic-release.outputs.released }} |
| 20 | + tag: ${{ steps.semantic-release.outputs.tag }} |
21 | 21 | concurrency: release |
22 | 22 | permissions: |
23 | 23 | id-token: write |
@@ -53,46 +53,38 @@ jobs: |
53 | 53 | run: | |
54 | 54 | git checkout -B ${{ github.ref_name }} ${{ github.sha }} |
55 | 55 |
|
| 56 | + - name: Update version and changelogs |
| 57 | + id: semantic-release |
| 58 | + uses: python-semantic-release/python-semantic-release@v9.15.2 |
| 59 | + with: |
| 60 | + build: false |
| 61 | + changelog: true |
| 62 | + commit: true |
| 63 | + push: true |
| 64 | + tag: true |
| 65 | + vcs-release: true |
| 66 | + github-token: ${{ steps.app-token.outputs.token }} |
| 67 | + |
56 | 68 | - name: Install the latest version of uv |
| 69 | + if: steps.semantic-release.outputs.released == 'true' |
57 | 70 | uses: astral-sh/setup-uv@v5 |
58 | 71 | with: |
59 | 72 | version: "latest" |
60 | 73 |
|
61 | | - - name: Setup environment with UV |
62 | | - run: | |
63 | | - uv sync --dev |
64 | | - |
65 | | - CURRENT_VERSION=$(uv run semantic-release --noop version --print-last-released) |
66 | | - NEXT_VERSION=$(uv run semantic-release --noop version --print) |
67 | | - TAG=$(uv run semantic-release --noop version --print-tag) |
68 | | -
|
69 | | - if [ "$CURRENT_VERSION" = "$NEXT_VERSION" ]; then |
70 | | - echo "deploy=false" >> $GITHUB_ENV |
71 | | - else |
72 | | - echo "deploy=true" >> $GITHUB_ENV |
73 | | - fi |
74 | | - echo "tag=$TAG" >> $GITHUB_OUTPUT |
75 | | -
|
76 | | - - name: Update version and changelogs |
77 | | - if: env.deploy |
78 | | - env: |
79 | | - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
80 | | - run: > |
81 | | - uv run semantic-release -vv version --skip-build |
82 | | - --commit --tag --changelog --push --vcs-release |
83 | | - |
84 | 74 | - name: Build and publish package distributions |
85 | | - if: env.deploy |
| 75 | + if: steps.semantic-release.outputs.released == 'true' |
86 | 76 | run: | |
| 77 | + uv sync --no-dev |
87 | 78 | uv build |
88 | 79 | uv publish |
89 | 80 |
|
90 | 81 | - name: Publish package distributions to GitHub Releases |
91 | | - if: env.deploy |
92 | | - env: |
93 | | - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
94 | | - run: | |
95 | | - uv run semantic-release -vv publish |
| 82 | + if: steps.semantic-release.outputs.released == 'true' |
| 83 | + id: publish-dist |
| 84 | + uses: python-semantic-release/publish-action@v9.15.2 |
| 85 | + with: |
| 86 | + github-token: ${{ steps.app-token.outputs.token }} |
| 87 | + tag: ${{ steps.semantic-release.outputs.tag }} |
96 | 88 |
|
97 | 89 | mkdocs: |
98 | 90 | name: Deploy documentation |
|
0 commit comments