Skip to content

chore(cd): revert to latest functional version #30

chore(cd): revert to latest functional version

chore(cd): revert to latest functional version #30

Workflow file for this run

name: Build & publish
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: read-all
on:
workflow_dispatch:
push:
branches: [main]
paths:
- '**/*.py'
- 'requirements.txt'
- 'pyproject.toml'
- .github/workflows/cd.yaml
release:
types:
- published
jobs:
build-package:
name: Build & verify package
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@v2.12.0
id: build-package
with:
attest-build-provenance-github: "true"
outputs:
package-version: ${{ steps.build-package.outputs.package_version }}
# Upload to Test PyPI on every commit on main.
release-test-pypi:
name: Publish in-dev package to test.pypi.org
needs: build-package
runs-on: ubuntu-latest
environment: test-pypi
permissions:
id-token: write
attestations: write
contents: read
if: github.repository_owner == 'indexa-git' && github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4.2.1
with:
name: Packages
path: dist
- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# Upload to real PyPI on GitHub Releases.
release-pypi:
name: Publish released package to pypi.org
needs: build-package
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/pyazul/${{ needs.build-package.outputs.package-version }}
permissions:
id-token: write
attestations: write
contents: read
if: github.repository_owner == 'indexa-git' && github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4.2.1
with:
name: Packages
path: dist
- name: Generate artifact attestations
uses: actions/attest-build-provenance@v2.2.3
with:
subject-path: dist/*
- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true