From 39a3a38d50d7cee05415e3c83e0873ede21ce793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Wed, 10 Jan 2024 12:55:53 -0600 Subject: [PATCH] ci: Use `hynek/build-and-inspect-python-package` --- .github/workflows/release.yml | 51 +++++++++++------------------------ pyproject.toml | 2 +- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dff4f2043..6acae23e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/pyproject.toml b/pyproject.toml index cb7965d09..ab9a565ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]