Skip to content

Commit 5adac30

Browse files
Add release step (#2)
* add release step * rename * use dev version * Apply suggestion from @akaszynski --------- Co-authored-by: user27182 <[email protected]>
1 parent ab48e7f commit 5adac30

File tree

3 files changed

+75
-42
lines changed

3 files changed

+75
-42
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
permissions:
17+
contents: read
18+
runs-on: ubuntu-24.04
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python-version: ['3.13']
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
cache: pip
32+
- name: Install dependencies
33+
run: |
34+
pip install --upgrade pip
35+
pip install . --group dev
36+
- name: Run tests
37+
run: pytest -v
38+
- name: Build wheel and sdist
39+
run: |
40+
pip install build
41+
python -m build
42+
- name: Upload build artifacts
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: dist-artifacts
46+
path: dist/
47+
48+
release:
49+
name: Release
50+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
51+
needs: [test]
52+
runs-on: ubuntu-24.04
53+
environment:
54+
name: pypi
55+
url: https://pypi.org/p/vtk-xref
56+
permissions:
57+
id-token: write # this permission is mandatory for trusted publishing
58+
contents: write # required to create a release
59+
steps:
60+
- uses: actions/download-artifact@v4
61+
- name: Flatten directory structure
62+
run: |
63+
mkdir -p dist/
64+
find . -name '*.whl' -exec mv {} dist/ \;
65+
find . -name '*.tar.gz' -exec mv {} dist/ \;
66+
- name: Publish package distributions to PyPI
67+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
68+
- name: Create GitHub Release
69+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8
70+
with:
71+
generate_release_notes: true
72+
files: |
73+
./**/*.whl

.github/workflows/test.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ vtk_xref.egg-info/
44
__pycache__/
55
#*.
66
tests/tinypages/_build
7-
.coverage
7+
.coverage
8+
dist

0 commit comments

Comments
 (0)