Skip to content

Commit

Permalink
ci: Use hynek/build-and-inspect-python-package (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Feb 6, 2024
1 parent 106a881 commit 48e95e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/release.yml
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:
Expand All @@ -40,5 +37,6 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Publish
uses: pypa/[email protected]
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ convention = "google"

[build-system]
requires = [
"poetry-core==1.5.0",
"poetry-dynamic-versioning==0.21.3",
"poetry-core==1.9",
"poetry-dynamic-versioning==1.2",
]
build-backend = "poetry_dynamic_versioning.backend"

Expand Down

0 comments on commit 48e95e4

Please sign in to comment.