-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Use
hynek/build-and-inspect-python-package
(#205)
- Loading branch information
1 parent
106a881
commit 48e95e4
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,34 @@ | ||
name: Build & Release | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] # Trigger only when a release is published, not when a release is drafted | ||
push: | ||
|
||
permissions: | ||
contents: write # Needed to upload artifacts to the release | ||
id-token: write # Needed for OIDC PyPI publishing | ||
|
||
jobs: | ||
build_and_release: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
environment: publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
publish: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
environment: | ||
name: publishing | ||
url: https://pypi.org/p/meltano-edk | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Build package | ||
run: | | ||
poetry self add "poetry-dynamic-versioning[plugin]" | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry dynamic-versioning --no-cache | ||
poetry build | ||
name: Packages | ||
path: dist | ||
- name: Upload wheel to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
|
@@ -40,5 +37,6 @@ jobs: | |
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true | ||
|
||
- name: Publish | ||
uses: pypa/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters