Skip to content

Commit 0784136

Browse files
authored
ci(release): change release to be triggered by GH releases (#608)
1 parent 18165d8 commit 0784136

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: upload release to PyPI
22
on:
3-
workflow_dispatch:
3+
release:
4+
types:
5+
- published
46

57
jobs:
68
pypi-publish:
@@ -12,22 +14,20 @@ jobs:
1214
contents: write
1315
steps:
1416
- uses: actions/[email protected]
15-
- uses: actions/[email protected]
1617
with:
17-
python-version: ">=3.10"
18-
- name: Get version
19-
run: |
20-
echo "version=$(date +'%Y.%m.%d.%H.%M')" >> "$GITHUB_ENV"
21-
- name: Tag and release
22-
env:
23-
GH_TOKEN: ${{ github.token }}
18+
fetch-depth: 0
19+
fetch-tags: true
20+
21+
- uses: actions/[email protected]
22+
with:
23+
python-version: 3.12
24+
25+
- name: Install build
2426
run: |
25-
git tag $version
26-
git push origin $version
27-
pip install poetry
28-
poetry self add poetry-dynamic-versioning[plugin]
29-
poetry install --sync
30-
poetry build
31-
gh release create --generate-notes $version ./dist/*
27+
pip install poetry
28+
poetry self add poetry-dynamic-versioning[plugin]
29+
poetry sync
30+
poetry build
31+
3232
- name: Publish package distributions to PyPI
3333
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77
license = "Apache License"
88

99
[build-system]
10-
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
10+
requires = ["poetry-core", "poetry-dynamic-versioning"]
1111
build-backend = "poetry_dynamic_versioning.backend"
1212

1313
[tool.poetry-dynamic-versioning]

0 commit comments

Comments
 (0)