Skip to content

Commit 7ce1561

Browse files
committed
move to use github semantic release instead of manual
1 parent cf603b5 commit 7ce1561

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

.github/workflows/python-package.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,13 @@ jobs:
5757
python-version: '3.10'
5858
cache: "poetry"
5959
- run: poetry install
60-
- name: Semantic release
61-
run: |
62-
pip install python-semantic-release==7.34.6
63-
git config --global user.name "github-actions"
64-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
65-
semantic-release changelog
66-
semantic-release version
67-
env:
68-
GH_TOKEN: ${{secrets.GH_REPO_TOKEN}}
69-
- name: Create GitHub Release
70-
run: |
71-
semantic-release publish --skip-build
72-
env:
73-
GH_TOKEN: ${{secrets.GH_REPO_TOKEN}}
74-
- name: Build package
75-
run: poetry build
60+
- name: Python Semantic Release
61+
id: release
62+
uses: python-semantic-release/[email protected]
63+
with:
64+
github_token: ${{ secrets.GH_REPO_TOKEN }}
7665
- name: Publish to PyPI
77-
uses: pypa/gh-action-pypi-publish@release/v1
66+
uses: pypa/gh-action-pypi-publish@release/v1
67+
if: steps.release.outputs.released == 'true'
68+
with:
69+
print-hash: true

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ build_command = "poetry build"
4040
major_on_zero = true
4141
tag_format = "v{version}"
4242

43+
[tool.semantic_release.publish]
44+
dist_glob_patterns = ["dist/*"]
45+
upload_to_vcs_release = true
46+
4347
[tool.semantic_release.branches.main]
4448
match = "(main|master)"
4549

0 commit comments

Comments
 (0)