Skip to content

Commit 5415a0d

Browse files
authored
Add release job (#5)
1 parent f620d3f commit 5415a0d

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- v*
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
environment: release
15+
permissions:
16+
id-token: write
17+
contents: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
- name: Setup python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
- name: Install project
26+
run: pip install -e .
27+
- name: Install libraries
28+
run: pip install -U build
29+
- name: Create wheel
30+
run: python -m build -o dist/ .
31+
- name: Publish package distributions to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
- name: Determine version
34+
run: |
35+
tag="${GITHUB_REF#refs/*/}"
36+
version="${tag:1}"
37+
echo "RELEASE_VERSION=${version}" >> $GITHUB_ENV
38+
- name: Release on GitHub
39+
uses: softprops/action-gh-release@v2
40+
with:
41+
files: dist/*
42+
name: Version ${{ env.RELEASE_VERSION }}

0 commit comments

Comments
 (0)