Skip to content

Commit ff1feea

Browse files
authored
gha: add release workflow using trusted publishing (#34)
1 parent 1a5c57a commit ff1feea

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
pypi:
8+
name: Publish to PyPI
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: release
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v7
20+
- name: Install Python 3.13
21+
run: uv python install 3.13
22+
- name: Build
23+
run: uv build
24+
# Check that basic features work and we didn't miss to include crucial files
25+
- name: Smoke test (wheel)
26+
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
27+
- name: Smoke test (source distribution)
28+
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
29+
- name: Publish
30+
run: uv publish

tests/smoke_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import ksuid
2+
3+
basic = ksuid.Ksuid()
4+
parsed = ksuid.Ksuid.from_base62(str(basic))
5+
assert parsed.timestamp == basic.timestamp
6+
7+
ms = ksuid.Ksuid()
8+
parsed = ksuid.Ksuid.from_base62(str(ms))
9+
assert parsed.timestamp == basic.timestamp
10+
11+
print("Ok")

0 commit comments

Comments
 (0)