Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ 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
Expand All @@ -40,17 +33,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:
Expand Down
Loading