diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml index dbd9a00c..a58de345 100644 --- a/.github/workflows/publish-to-pypi.yaml +++ b/.github/workflows/publish-to-pypi.yaml @@ -6,22 +6,13 @@ on: - v[0-9]+.[0-9]+.[0-9]+ jobs: - publish: - name: Build + build: + name: Build distribution runs-on: ubuntu-latest - # This environment is required as an input to pypa/gh-action-pypi-publish - environment: - name: pypi - url: https://pypi.org/p/seclab-taskflow-agent - - env: - GITHUB_REPO: ${{ github.repository }} permissions: - contents: write - id-token: write # For trusted publishing - attestations: write # For artifact attestation + contents: read steps: - name: Checkout repository @@ -40,17 +31,42 @@ jobs: - name: Build the wheel run: python3 -m hatch build - - name: Attest build provenance - uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 - with: - subject-path: ./dist/* - - name: Upload artifacts uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: python-package-distributions path: ./dist/ + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + + # This environment is required as an input to pypa/gh-action-pypi-publish + environment: + name: pypi + url: https://pypi.org/p/seclab-taskflow-agent + + env: + GITHUB_REPO: ${{ github.repository }} + + permissions: + contents: write + id-token: write # For trusted publishing + attestations: write # For artifact attestation + + steps: + - name: Download distribution artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: python-package-distributions + path: ./dist/ + + - name: Attest build provenance + uses: actions/attest@v4.1.0 # immutable release + with: + subject-path: ./dist/* + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 with: