Skip to content

Commit 0e49489

Browse files
authored
Adding GH workflow for doing a release (#240)
1 parent 722d582 commit 0e49489

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
jobs:
8+
build:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/project/skmatter
14+
permissions:
15+
id-token: write
16+
contents: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: setup Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.13"
26+
- run: python -m pip install tox
27+
- name: Build package
28+
run: tox -e build
29+
- name: Publish distribution to PyPI
30+
if: startsWith(github.ref, 'refs/tags/v')
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
- name: Publish to GitHub release
33+
if: startsWith(github.ref, 'refs/tags/v')
34+
uses: softprops/action-gh-release@v2
35+
with:
36+
files: |
37+
dist/*.tar.gz
38+
dist/*.whl
39+
prerelease: ${{ contains(github.ref, '-rc') }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)