-
Notifications
You must be signed in to change notification settings - Fork 14
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
- Loading branch information
1 parent
09053b0
commit 2fd1304
Showing
1 changed file
with
21 additions
and
32 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,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 |