release #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
bump_version: | |
type: choice | |
description: "bump version" | |
default: minor | |
options: | |
# major version bumps do only manually | |
- minor | |
- patch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
run-checks: | |
uses: ./.github/workflows/code-checks.yaml | |
with: | |
branch_ref: ${{ github.ref }} | |
release: | |
needs: run-checks | |
timeout-minutes: 20 | |
runs-on: ubuntu-22.04 | |
environment: release | |
permissions: | |
contents: write | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Setup git user | |
run: | | |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
- name: Prepare Node | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install poetry | |
run: pip install poetry | |
- name: Prepare Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'poetry' | |
- name: Prepare release | |
run: ./bin/prepare-release.sh ${{ github.event.inputs.bump_version }} | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1.9 | |
with: | |
packages-dir: ffun/dist/ | |
- name: Publish package distributions to NPM | |
working-directory: site | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_SECRET }} |