generated from bentheiii/template-python-poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.41 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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