Skip to content

🔖 Release v0.38.4 #53

🔖 Release v0.38.4

🔖 Release v0.38.4 #53

Workflow file for this run

name: Version Release
on:
push:
tags:
- '\d+\.\d+\.\d+' # Push events to matching d.d.d, i.e. 1.0.0, 15.26.35
jobs:
run-tests:
name: Trigger tests.yml
uses: ./.github/workflows/tests.yml
github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: run-tests
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.2
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
pypi-release:
name: Publish on PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
# Make sure the version of setup is the same as the version in tag
- name: Get version from pyproject.toml
id: get_version
run: |
pyproject_version=$(python -c "import re; version = re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1); print(version)")
echo "pyproject_version=$pyproject_version" >> $GITHUB_ENV
init_git_version=$(python -c "import re; version = re.search(r'__version__ = \"(.+?)\"', open('hezar/__init__.py').read()).group(1); print(version)")
echo "init_git_version=$init_git_version" >> $GITHUB_ENV
- name: Extract Git tag
run: |
GIT_TAG=${GITHUB_REF##*/}
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
- name: Check if versions match
run: |
if [[ ${{ env.pyproject_version }} != "${{ env.GIT_TAG }}" ]]; then
echo "[Error]: Version Missmatch!"
exit 1
fi
if [[ ${{ env.GIT_TAG }} != "${{ env.init_git_version }}" ]]; then
echo "[Error]: Version Missmatch!"
exit 1
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine poetry
- name: Publish package to PYPI
run: |
poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}"
poetry publish --build
needs:
- github-release
call-docs-workflow:
name: Trigger docs-deploy.yml
uses: ./.github/workflows/docs-deploy.yml
needs:
- pypi-release