Skip to content

release

release #8

Workflow file for this run

name: publish
on:
workflow_dispatch:
inputs:
VERSION:
description: "The version to release"
required: true
IS_PRE_RELEASE:
description: "It IS a pre-release"
required: true
default: false
type: boolean
jobs:
publish:
runs-on: ubuntu-latest
env:
VERSION: ${{ inputs.VERSION }}
GH_TOKEN: ${{ github.token }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
environment:
name: pypi
url: https://pypi.org/p/nextplot
permissions:
id-token: write # This is required for trusted publishing to PyPI
contents: write
steps:
- name: set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: install dependencies
run: |
pip install --upgrade pip
pip install build twine hatch
- name: configure git with the bot credentials
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.NEXTMVBOT_SSH_KEY }}"
echo "${{ secrets.NEXTMVBOT_SIGNING_KEY }}" > ~/.ssh/signing.key
chmod 600 ~/.ssh/signing.key
git config --global user.name "nextmv-bot"
git config --global user.email "[email protected]"
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/signing.key
git clone [email protected]:nextmv-io/nextplot.git
- name: upgrade version with hatch
run: hatch version ${{ env.VERSION }}
working-directory: ./nextplot
- name: commit new version
run: |
git add nextplot/__about__.py
git commit -S -m "Bump version to $VERSION"
git push
git tag $VERSION
git push origin $VERSION
working-directory: ./nextplot
- name: create release
run: |
PRERELEASE_FLAG=""
if [ ${{ inputs.IS_PRE_RELEASE }} = true ]; then
PRERELEASE_FLAG="--prerelease"
fi
gh release create $VERSION \
--verify-tag \
--generate-notes \
--title $VERSION $PRERELEASE_FLAG
working-directory: ./nextplot
- name: build binary wheel and source tarball
run: python -m build
working-directory: ./nextplot
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./nextplot/dist