From 2fd13046ae3662a6f7ed407eb52b8c568d3cb8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Tue, 23 Jan 2024 11:39:19 -0600 Subject: [PATCH] ci: Use `hynek/build-and-inspect-python-package` --- .github/workflows/release.yaml | 53 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7a49c877..381b698d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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/checkout@v4.0.0 + - uses: actions/checkout@v4.0.0 with: fetch-depth: 0 + - uses: hynek/build-and-inspect-python-package@v2 - - name: Set up Python - uses: actions/setup-python@v4.6.1 + 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/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11