Skip to content

Commit ed9bd27

Browse files
ci: secure and enhance publish workflow
1 parent c4d76ac commit ed9bd27

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,28 @@ jobs:
1616
contents: read
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v6
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020
- name: Install uv
21-
uses: astral-sh/setup-uv@v7
21+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
2222
- name: Install Python 3.12
2323
run: uv python install 3.12
2424
- name: Build
2525
run: uv build
26+
- name: Verify tag matches version
27+
run: |
28+
VERSION=$(grep "__version__ =" temoa/__about__.py | cut -d "'" -f 2)
29+
TAG=${GITHUB_REF#refs/tags/v}
30+
if [ "$VERSION" != "$TAG" ]; then
31+
echo "Error: Tag v$TAG does not match version $VERSION in temoa/__about__.py"
32+
exit 1
33+
fi
34+
echo "Tag v$TAG matches version $VERSION"
2635
# Check that basic features work and we didn't miss to include crucial files
2736
- name: Smoke test (wheel)
37+
timeout-minutes: 10
2838
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
2939
- name: Smoke test (source distribution)
40+
timeout-minutes: 10
3041
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
3142
- name: Publish
3243
run: uv publish

0 commit comments

Comments
 (0)