From 120cb5f0a053746c629f5fd168450e6bef31f95f Mon Sep 17 00:00:00 2001 From: Bartosz Sokorski Date: Tue, 15 Apr 2025 13:32:30 +0200 Subject: [PATCH] Fix noext builds and setup or Trusted publisher --- .github/workflows/release.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93e20e3e..8e796ffc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,14 +99,16 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - version: 1.8.5 + run: pipx install poetry + - name: Hotswap build backend for Poetry + # Maturin doesn't support building no-extension wheels, so we swap to Poetry for that + run: | + sed -i '/^\[build-system\]/,/^\[/{s/^requires = .*/requires = ["poetry-core>=2.0.0,<3.0.0"]/ s/^build-backend = .*/build-backend = "poetry.core.masonry.api"/}' pyproject.toml - name: Install dependencies run: poetry install --only main --only test --only typing --only build - name: Run poetry build run: poetry build - - name: Upload sdist + - name: Upload no-ext wheel uses: actions/upload-artifact@v4 with: name: dist-any @@ -117,10 +119,12 @@ jobs: needs: [ build, build_sdist, build_none ] if: success() runs-on: ubuntu-latest - environment: release permissions: id-token: write contents: write + environment: + name: pypi + url: https://pypi.org/project/pendulum/ steps: - name: Checkout code uses: actions/checkout@v2 @@ -132,9 +136,6 @@ jobs: path: dist merge-multiple: true - - name: Update PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Check distributions run: | ls -la dist @@ -151,6 +152,7 @@ jobs: artifacts: "dist/*" draft: false prerelease: steps.check-version.outputs.prerelease == 'true' + body: "See CHANGELOG.md for details" - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1