Skip to content

File tree

1 file changed

+41
-17
lines changed

1 file changed

+41
-17
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,48 @@
1-
name: Python package
1+
name: Publish Test PyPI on Release
2+
23
on:
34
push:
45
tags:
5-
- "v*.*.*.*"
6+
- 'v*.*.*.*'
7+
8+
permissions:
9+
contents: read
10+
611
jobs:
7-
build:
12+
test-pypi-publish:
13+
name: Upload release to Test PyPI
814
runs-on: ubuntu-latest
15+
environment:
16+
name: testpypi
17+
url: https://test.pypi.org/project/jsonschema-fill-default/
18+
permissions:
19+
id-token: write
920
steps:
10-
- run: echo "Job automatically triggered by a tagged ${{ github.event_name }} event."
11-
- uses: actions/checkout@v3
12-
- name: Build and publish to pypi
13-
uses: JRubics/[email protected]
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python 3.9
25+
uses: actions/setup-python@v5
1426
with:
15-
pypi_token: ${{ secrets.TESTPYPI }}
16-
repository_name: "jsonschema-fill-default"
17-
repository_url: "https://test.pypi.org/projects/jsonschema-fill-default"
18-
19-
#steps:
20-
#- uses: actions/checkout@v3
21-
#- name: Build and publish to pypi
22-
# uses: JRubics/[email protected]
23-
# with:
24-
# pypi_token: ${{ secrets.PYPI_TOKEN }}
27+
python-version: "3.9"
28+
29+
- name: Install Poetry
30+
run: |
31+
curl -sSL https://install.python-poetry.org | python - -y
32+
33+
- name: Update PATH
34+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
35+
36+
- name: Update Poetry configuration
37+
run: poetry config virtualenvs.create false
38+
39+
- name: Install dependencies
40+
run: poetry install --sync --no-interaction
41+
42+
- name: Package project
43+
run: poetry build
44+
45+
- name: Publish package distributions to PyPI
46+
uses: pypa/gh-action-pypi-publish@release/v1
47+
with:
48+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)