Release #24
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: | |
version: | |
description: 'Version' | |
required: true | |
jobs: | |
release-py-partiql-parser: | |
runs-on: ubuntu-latest | |
name: Release Py-Partiql-Parser | |
permissions: | |
packages: write | |
env: | |
VERSION: 0.0.0 | |
steps: | |
- name: Set Env | |
run: | | |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install hatchling packaging twine build --upgrade | |
- name: Verify Tag does not exist | |
run: | | |
! git rev-parse ${{ env.VERSION }} || { echo "Ensure that no tag exists for ${{ env.VERSION }}" ; exit 1; } | |
- name: Update release version | |
run: | | |
sed -i 's/^version =.*$/version = "${{ env.VERSION }}"/g' pyproject.toml | |
- name: Build | |
run: python -m build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} | |
- name: Tag version on Github | |
run: | | |
git tag ${{ env.VERSION }} | |
git push origin ${{ env.VERSION }} | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.VERSION }} | |
tag_name: ${{ env.VERSION }} | |
files: dist/* |