Skip to content

Commit 48e95e4

Browse files
ci: Use hynek/build-and-inspect-python-package (#205)
1 parent 106a881 commit 48e95e4

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

.github/workflows/release.yml

+18-20
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
name: Build & Release
1+
name: Release
22

33
on:
4-
release:
5-
types: [published] # Trigger only when a release is published, not when a release is drafted
4+
push:
65

76
permissions:
87
contents: write # Needed to upload artifacts to the release
98
id-token: write # Needed for OIDC PyPI publishing
109

1110
jobs:
12-
build_and_release:
13-
11+
build:
1412
runs-on: ubuntu-latest
15-
environment: publishing
16-
1713
steps:
1814
- uses: actions/checkout@v4
1915
with:
2016
fetch-depth: 0
21-
- name: Set up Python
22-
uses: actions/setup-python@v5
17+
- uses: hynek/build-and-inspect-python-package@v2
18+
19+
publish:
20+
name: Publish to PyPI
21+
runs-on: ubuntu-latest
22+
needs: [build]
23+
environment:
24+
name: publishing
25+
url: https://pypi.org/p/meltano-edk
26+
if: startsWith(github.ref, 'refs/tags/')
27+
steps:
28+
- uses: actions/download-artifact@v4
2329
with:
24-
python-version: '3.10'
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install poetry
29-
- name: Build package
30-
run: |
31-
poetry self add "poetry-dynamic-versioning[plugin]"
32-
poetry config repositories.testpypi https://test.pypi.org/legacy/
33-
poetry dynamic-versioning --no-cache
34-
poetry build
30+
name: Packages
31+
path: dist
3532
- name: Upload wheel to release
3633
uses: svenstaro/upload-release-action@v2
3734
with:
@@ -40,5 +37,6 @@ jobs:
4037
tag: ${{ github.ref }}
4138
overwrite: true
4239
file_glob: true
40+
4341
- name: Publish
4442
uses: pypa/[email protected]

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ convention = "google"
103103

104104
[build-system]
105105
requires = [
106-
"poetry-core==1.5.0",
107-
"poetry-dynamic-versioning==0.21.3",
106+
"poetry-core==1.9",
107+
"poetry-dynamic-versioning==1.2",
108108
]
109109
build-backend = "poetry_dynamic_versioning.backend"
110110

0 commit comments

Comments
 (0)