-
Notifications
You must be signed in to change notification settings - Fork 46
65 lines (56 loc) · 1.72 KB
/
python-publish.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
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Python package
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Lock api
run: poetry -C api/ lock
- name: Build and publish api to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
package_directory: "api"
allow_poetry_pre_release: "yes"
poetry_install_options: "--sync"
poetry_publish_options: "--skip-existing"
- name: Lock cli
run: |
while true; do
pypi_page=$(curl --silent -L "https://pypi.org/project/anipy-api")
if grep -q "${GITHUB_REF#refs/*/v}" <<< $pypi_page; then
break
fi
sleep 2
done
poetry -C cli/ lock
- name: Build and publish cli to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
package_directory: "cli"
allow_poetry_pre_release: "yes"
poetry_install_options: "--sync"
poetry_publish_options: "--skip-existing"
- name: Lock root
run: poetry lock
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "ci: lock file update"
branch: master