Skip to content

Release

Release #9

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
patch:
description: 'Patch version'
required: false
default: false
type: boolean
package:
description: 'Package to release, or "all" to release all packages'
required: true
default: 'all'
type: choice
options:
- all
- main
- shims
jobs:
release-pypi:
name: release-pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Get version
id: get_version
run: |
if [ "${{ github.event.inputs.patch }}" = "true" ]; then
echo "VERSION=$(python .github/scripts/get_version.py --patch)" >> $GITHUB_OUTPUT
else
echo "VERSION=$(python .github/scripts/get_version.py)" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: '${{ github.event.inputs.package }}@v${{ steps.get_version.outputs.VERSION }}'
tag_name: 'v${{ steps.get_version.outputs.VERSION }}'
- name: Pull tags
run: git pull --tags
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Build main
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'main'
run: pipx run build
- name: Build shims
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'shims'
run: pipx run build -C mina-target=shims
- name: Upload to Pypi
run: |
pipx run twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*