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 10, 2024
1 parent f914452 commit 39a3a38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 36 deletions.
51 changes: 16 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,32 @@ name: Release

on:
push:
tags:
- v*

permissions:
contents: write # Needed to upload artifacts to the release
id-token: write # Needed for OIDC PyPI publishing

jobs:
release:
name: Publish to PyPI
build:
runs-on: ubuntu-latest
environment: publishing

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/checkout@v4
with:
python-version: "3.11"

- name: Upgrade pip
env:
PIP_CONSTRAINT: .github/workflows/constraints.txt
run: |
pip install pip
pip --version
- name: Install Poetry
env:
PIP_CONSTRAINT: .github/workflows/constraints.txt
run: |
pipx install poetry
poetry --version
- name: Check version
run: |
version=$(poetry version | awk '{print $2}')
tag=$(echo "${{ github.ref }}" | awk '{split($0,p,"/"); print p[3]}')
if [ "v$version" != $tag ]; then echo "Release tag and package version do not match!"; exit 1; fi;
- name: Build
run: poetry build
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: publishing
url: https://pypi.org/p/singer-sdk
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ module = [
]

[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core==1.8.1"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down

0 comments on commit 39a3a38

Please sign in to comment.