Update Pyrogram to v2.1.35 #1
Workflow file for this run
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
on: | |
push: | |
tags: | |
- 'v*' | |
permissions: write-all | |
jobs: | |
build-n-publish: | |
name: Build and publish to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Build source and wheel distributions | |
run: | | |
python -m pip install --upgrade build twine | |
python -m build | |
make venv | |
make api | |
twine check --strict dist/Kurigram* | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Set the Version | |
run: | | |
grep_result=$(grep version pyrogram/__init__.py) | |
prefix="__version__ = \"" | |
suffix="\"" | |
final_value=${grep_result#"$prefix"} | |
final_value=${final_value%"$suffix"} | |
echo "CURRENT_LIB_VERSION=$(echo 'v'$final_value)" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
id: create_release | |
uses: elgohr/Github-Release-Action@v5 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag: ${{ env.CURRENT_LIB_VERSION }} | |
title: ${{ env.CURRENT_LIB_VERSION }} | |
# draft: false | |
prerelease: false | |
- name: Get Asset name | |
run: | | |
export PKG=$(ls dist/ | grep tar) | |
set -- $PKG | |
echo "name=$1" >> $GITHUB_ENV | |
- name: Upload Release Asset (sdist) to GitHub | |
id: upload-release-asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
tag_name: ${{ env.CURRENT_LIB_VERSION }} | |
files: dist/* | |
# asset_name: ${{ env.name }} | |
# asset_content_type: application/zip |