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 Jan 23, 2024
1 parent 09053b0 commit 2fd1304
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,42 @@
name: Publish with Dynamic Versioning

on:
release:
types: [published]
on: push

permissions:
contents: write
id-token: write
contents: write # Upload artifacts to release
id-token: write # Use PyPI trusted publishing

jobs:
publish:
name: Publish to PyPI
build:
name: Build and Inspect
runs-on: ubuntu-latest
environment: publishing
env:
PIP_CONSTRAINT: .github/workflows/constraints.txt
steps:
- name: Checkout code
uses: actions/[email protected]
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

- name: Set up Python
uses: actions/[email protected]
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
environment:
name: publishing
url: https://pypi.org/p/meltano-tap-facebook
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
python-version: "3.10"

- name: Upgrade pip
run: |
pip install pip
pip --version
- name: Install Poetry
run: |
pipx install poetry
pipx inject poetry poetry-dynamic-versioning[plugin]
poetry --version
poetry self show plugins
- name: Build
run: poetry build

name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.whl
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Publish
uses: pypa/[email protected].10
uses: pypa/[email protected].11

0 comments on commit 2fd1304

Please sign in to comment.