Skip to content

Commit 3d688d5

Browse files
authored
fix: automatic releases (#29)
1 parent 1b8a0c3 commit 3d688d5

3 files changed

Lines changed: 25 additions & 33 deletions

File tree

.github/workflows/release.yaml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
runs-on: ubuntu-latest
1717
environment: release
1818
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 }}
2121
concurrency: release
2222
permissions:
2323
id-token: write
@@ -53,46 +53,38 @@ jobs:
5353
run: |
5454
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
5555
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+
5668
- name: Install the latest version of uv
69+
if: steps.semantic-release.outputs.released == 'true'
5770
uses: astral-sh/setup-uv@v5
5871
with:
5972
version: "latest"
6073

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-
8474
- name: Build and publish package distributions
85-
if: env.deploy
75+
if: steps.semantic-release.outputs.released == 'true'
8676
run: |
77+
uv sync --no-dev
8778
uv build
8879
uv publish
8980
9081
- 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 }}
9688

9789
mkdocs:
9890
name: Deploy documentation

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can install this handler by specifying it as a dependency:
1919
# adapt to your dependencies manager
2020
[project]
2121
dependencies = [
22-
"mkdocstrings-matlab>=0.4.0",
22+
"mkdocstrings-matlab>=0.X.Y",
2323
]
2424
```
2525

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mkdocstrings-matlab"
3-
version = "0.4.2"
3+
version = "0.4.1"
44
description = "A MATLAB handler for mkdocstrings"
55
authors = [
66
{ name = "Mark Hu", email = "watermarkhu@gmail.com" }

0 commit comments

Comments
 (0)