Skip to content

Bump version to v0.2.224.2 #23

Bump version to v0.2.224.2

Bump version to v0.2.224.2 #23

Workflow file for this run

name: Auto Tag and Upload Python Package
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
tag_and_publish:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Extract Version from File
id: version
run: |
VERSION=$(grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Check for Existing Release
id: check_release
run: |
TAG_EXISTS=$(curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/${{ env.VERSION }})
if [ "$TAG_EXISTS" -eq 200 ]; then
echo "Release with tag ${{ env.VERSION }} already exists."
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
else
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Get Commit Messages
id: get_commits
run: |
echo "## Release Notes" > release_notes.txt
echo "" >> release_notes.txt
echo "### $(git log -1 --pretty=format:"%s")" >> release_notes.txt
echo "" >> release_notes.txt
git log -1 --pretty=format:"%b" >> release_notes.txt
- name: Create New Release
if: env.RELEASE_EXISTS == 'false'
uses: comnoco/create-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GX_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body_path: ./release_notes.txt
- name: Build and publish
if: env.RELEASE_EXISTS == 'false'
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
hatch build
hatch publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}