Skip to content

chore: Still setting up package workflow #1

chore: Still setting up package workflow

chore: Still setting up package workflow #1

Workflow file for this run

name: deploy-on-push-main
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy-docs:
name: Deploy documentation
runs-on: ubuntu-latest
steps:
# Checkout this repository and cd to project root, set up python/pdm and cache
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: pdm-project/setup-pdm@v3
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
# Build and push docs to gh-pages branch (triggers doc site publish action)
- run: pdm sync
- run: pdm run mkdocs gh-deploy --force
build:
name: Build distribution
if: startsWith(github.ref, 'refs/tags/v') # Only build on vX.X.X releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: pdm-project/setup-pdm@v3
- run: pdm build
- uses: action/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/amisc
permissions:
id-token: write # trusted publishing
steps:
- uses: actions/download-artifacts@v3
with:
name: python-package-distributions
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Github release
needs:
- publish-pypi
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/download-artifacts@v3
with:
name: python-package-distributions
path: dist/
- uses: sigstore/gh-action-sigstore-python@v1.2.3
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create Github Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes-from-tag
- name: Upload artifacts
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'