Skip to content

chore(copier): update from template #11

chore(copier): update from template

chore(copier): update from template #11

# This file is @generated by <https://github.com/liblaf/copier-python>.
# DO NOT EDIT!
name: (Shared) Release
on:
push:
release:
types:
- published
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
artifact-name: ${{ steps.build.outputs.artifact-name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: build
name: Build and Inspect a Python Package
uses: hynek/build-and-inspect-python-package@v2
publish:
name: Publish
permissions:
id-token: write
needs:
- build
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-publish
cancel-in-progress: true
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
pre-release:
name: Pre-Release
permissions:
contents: write
needs:
- build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-pre-release
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: dist/
- name: Create Pre-Release
uses: liblaf/actions/release@main
with:
clobber: true
files: dist/*
prerelease: true
tag: latest
release:
name: Release
permissions:
contents: write
needs:
- build
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-release
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact-name }}
path: dist/
- name: Upload Release Assets
uses: liblaf/actions/release@main
with:
files: dist/*
tag: ${{ github.event.release.tag_name || github.ref_name }}