Skip to content

Merge pull request #19 from adrn/dependabot/github_actions/codecov/co… #40

Merge pull request #19 from adrn/dependabot/github_actions/codecov/co…

Merge pull request #19 from adrn/dependabot/github_actions/codecov/co… #40

Workflow file for this run

name: CD
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
jobs:
dist:
name: Distribution build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
# Upload to Test PyPI on every commit on main.
test-publish:
needs: [dist]
name: Test Publish to TestPyPI
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if:
github.repository_owner == 'adrn' && 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
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/
publish:
needs: [dist]
name: Publish to PyPI
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'