Skip to content

Commit 4fc4119

Browse files
authored
ci: add publish step (#6)
1 parent 09c1fbb commit 4fc4119

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

.github/workflows/ci.yaml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,41 @@ jobs:
1111
uses: ./.github/workflows/test.yaml
1212
tag:
1313
name: Tag
14+
timeout-minutes: 2
1415
needs: test
1516
permissions:
1617
contents: write
17-
uses: ./.github/workflows/tag.yaml
18-
# TODO: Publish to Pypi.
18+
outputs:
19+
new-version: ${{ steps.bump-version.outputs.new_version }}
20+
steps:
21+
- name: Check out
22+
uses: actions/checkout@v4
23+
- name: Bump version and create tag
24+
id: bump-version
25+
uses: mathieudutour/[email protected]
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish:
29+
name: Publish package to PyPI
30+
timeout-minutes: 3
31+
runs-on: ubuntu-latest
32+
needs: tag
33+
if: needs.tag.outputs.new-version != ''
34+
permissions:
35+
contents: read
36+
packages: write
37+
steps:
38+
- name: Check out
39+
uses: actions/checkout@v4
40+
- name: Set up
41+
uses: ./.github/actions/setup
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
- name: Set version
45+
run: |
46+
poetry version "${{ needs.tag.outputs.new-version }}"
47+
- name: Publish
48+
run: |
49+
poetry publish --build
50+
env:
51+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}

.github/workflows/tag.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)