Skip to content

Commit

Permalink
ci: release on release publish
Browse files Browse the repository at this point in the history
Change-Id: Ia209b3e2d9a894ae8c00bac1fe9c3f38885826da
  • Loading branch information
jd committed Dec 11, 2024
1 parent 64e55cf commit f2ec73c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: upload release to PyPI
on:
workflow_dispatch:
release:
types:
- published

jobs:
pypi-publish:
Expand All @@ -11,23 +13,21 @@ jobs:
id-token: write
contents: write
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: ">=3.10"
- name: Get version
run: |
echo "version=$(date +'%Y.%m.%d.%H.%M')" >> "$GITHUB_ENV"
- name: Tag and release
env:
GH_TOKEN: ${{ github.token }}
fetch-depth: 0
fetch-tags: true

- uses: actions/[email protected]
with:
python-version: 3.12

- name: Install build
run: |
git tag $version
git push origin $version
pip install poetry
poetry self add poetry-dynamic-versioning[plugin]
poetry install --sync
poetry build
gh release create --generate-notes $version ./dist/*
pip install poetry
poetry self add poetry-dynamic-versioning[plugin]
poetry install --sync
poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ semgrep = "^1.99.0"
yamllint = "^1.35.1"

[build-system]
requires = ["poetry-core"]
requires = ["poetry-core", "poetry-dynamic-versioning"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.plugins.pytest11]
Expand All @@ -44,3 +44,9 @@ module = [
"pytest_opentelemetry.*"
]
ignore_missing_imports = true

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
dirty = true
pattern = "default-unprefixed"

0 comments on commit f2ec73c

Please sign in to comment.