Skip to content

Commit

Permalink
ci: Use hynek/build-and-inspect-python-package
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Feb 6, 2024
1 parent 106a881 commit bb6ccb1
Showing 1 changed file with 18 additions and 20 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]

0 comments on commit bb6ccb1

Please sign in to comment.