Skip to content

Commit 8510070

Browse files
committed
ci: pull publish into main
1 parent 2e32401 commit 8510070

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

.github/workflows/pypi.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,39 @@ jobs:
88
steps:
99
- uses: https://git.yusufali.ca/actions/commit@main
1010

11-
- uses: https://git.yusufali.ca/actions/pythonpip@main
11+
- name: Check out code
12+
uses: actions/checkout@v2
1213
with:
13-
pypiptoken: ${{ secrets.PYPI_TOKEN }}
14+
submodules: true
15+
fetch-depth: 0
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: 3.13
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r requirements.txt
25+
pip install build twine
26+
27+
- name: Get Current Version
28+
id: previoustag
29+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
30+
with:
31+
fallback: 0.0.1
32+
33+
- name: Setup Version
34+
env:
35+
TAG: ${{ steps.previoustag.outputs.tag }}
36+
run: |
37+
sed -i "s/version = .*/version = \"$TAG\"/g" pyproject.toml
38+
cat pyproject.toml
39+
40+
- name: Build package
41+
run: python -m build
42+
43+
- name: Publish package
44+
if: github.ref_name == 'main'
45+
run: |
46+
python -m twine upload dist/* --non-interactive -u__token__ -p${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)