1.4.0 #19
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
name: Deploy to PyPI | |
on: | |
release: | |
types: [ published, edited ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install PIP | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
sh scripts/install.sh | |
- name: Assert Version Correctness | |
run: | | |
TOML_VER=$(poetry version | awk -F' ' '{ print $2 }') | |
echo toml "$TOML_VER" | |
GIT_VER=${{ github.event.release.tag_name }} | |
echo git "$GIT_VER" | |
LIB_VER=$(python -c "exec(open('envolved/_version.py').read()); print(__version__)") | |
echo lib "$LIB_VER" | |
[[ "$TOML_VER" == "$GIT_VER" ]] | |
[[ "$TOML_VER" == "$LIB_VER" ]] | |
- name: Publish | |
env: | |
PYPI_USERNAME: ${{ secrets.pypi_user }} | |
PYPI_PASSWORD: ${{ secrets.pypi_password }} | |
run: | | |
poetry publish -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" --build | |
- name: Upload Binaries as Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: binaries | |
path: dist | |
- name: Upload Binaries to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |