Skip to content

Commit 9246ae3

Browse files
committed
Github actions publishing
1 parent 022a642 commit 9246ae3

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
FORCE_COLOR: 1
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: astral-sh/setup-uv@v6
17+
18+
- name: Set version from tag
19+
run: uv version "${GITHUB_REF_NAME#v}"
20+
21+
- name: Build package
22+
run: uv build
23+
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: dist
27+
path: dist/
28+
29+
publish:
30+
runs-on: ubuntu-latest
31+
needs: build
32+
environment: pypi
33+
permissions:
34+
id-token: write
35+
contents: write
36+
steps:
37+
- uses: actions/download-artifact@v4
38+
with:
39+
name: dist
40+
path: dist/
41+
42+
- uses: pypa/gh-action-pypi-publish@release/v1
43+
44+
- name: Upload wheels to GitHub Release
45+
run: gh release upload "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY"
46+
env:
47+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)