Skip to content

Commit 5e4cbf5

Browse files
committed
[main]: added publish workflow
1 parent 853b8dd commit 5e4cbf5

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to TestPyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
REPO_ALIAS: rz-sample
10+
TEST_PYPI_URL: https://test.pypi.org/legacy/
11+
12+
jobs:
13+
build-and-publish:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.11"
24+
25+
- name: Install Poetry
26+
run: |
27+
curl -sSL https://install.python-poetry.org | python3 -
28+
echo "$HOME/.local/bin" >> $GITHUB_PATH
29+
30+
- name: Configure Poetry for TestPyPI
31+
run: |
32+
# Use the variables defined in the 'env' section
33+
poetry config repositories.${{ env.REPO_ALIAS }} ${{ env.TEST_PYPI_URL }}
34+
poetry config pypi-token.${{ env.REPO_ALIAS }} ${{ secrets.TEST_PYPI_TOKEN }}
35+
36+
- name: Build and Publish
37+
run: |
38+
# Automatically uses the alias for the -r flag
39+
poetry publish -r ${{ env.REPO_ALIAS }} --build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ poetry env remove <environment-full-name>
184184
- [Virtualenv Docs](https://docs.python.org/3/library/venv.html)
185185
- [Poetry Docs](https://python-poetry.org/docs/)
186186
- [MyPy Docs](https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports)
187-
- [Useful Poetry commands](https://github.com/recursivezero/python/wiki/POETRY_COMMANDS.md)
187+
- [Useful Poetry Commands](https://github.com/recursivezero/python/wiki/POETRY_COMMANDS)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rz-sample"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
description = "A python template for fastapi and streamlit projects."
55
authors = [{ name = "sample", email = "recursivezero@outlook.com" }]
66
license = "MIT"

0 commit comments

Comments
 (0)