pyautoenv release #15
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: pyautoenv release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: New version e.g., 3.1.4 | |
required: true | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Validate Version | |
run: | | |
python -m pip install toml | |
poetry_version="$(python -c 'import toml; print(toml.load("pyproject.toml")["tool"]["poetry"]["version"])')" | |
echo "Version from input: ${{ github.event.inputs.version }}" | |
echo "Version from poetry: ${poetry_version}" | |
if ! [ "${{ github.event.inputs.version }}" = "${poetry_version}" ]; then | |
exit 1; | |
fi | |
script_version="$(python -c 'import pyautoenv; print(pyautoenv.__version__)')" | |
echo "Version from script: ${script_version}" | |
if ! [ "${poetry_version}" = "${script_version}" ]; then | |
exit 1; | |
fi | |
- name: Release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "v${{ github.event.inputs.version }}" \ | |
--target main \ | |
--generate-notes \ | |
--draft |