1- name : Release Project Version
1+ name : Release Version
22
33on :
4- pull_request :
54 push :
6- branches :
7- - main
5+ tags :
6+ - " v*"
7+
8+ jobs :
9+
10+ # Build Python Package.
11+ build-package :
12+ name : Build Package
13+
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : 🛎 Checkout
18+ uses : actions/checkout@v4
19+ with :
20+ ref : ${{ github.head_ref }}
21+
22+ - name : 🐍 Setup Python
23+ uses : actions/setup-python@v5
24+ with :
25+ python-version : " 3.13"
26+ cache : " pip"
27+
28+ - name : 📦 Install Hatch
29+ uses : pypa/hatch@install
30+
31+ - name : 🔨 Build Package
32+ run : hatch build
33+
34+ - name : ⬆️ Upload Artifacts
35+ uses : actions/upload-pages-artifact@v3
36+ with :
37+ name : python-package-distributions
38+ path : dist/
39+
40+ # Publishing to PyPI
41+ publish-to-test-pypi :
42+ name : Publish to Test PyPI
43+
44+ needs : build-package
45+
46+ runs-on : ubuntu-latest
47+
48+ environment :
49+ name : testpypi
50+ url : https://testpypi.org/p/ephys-link
51+
52+ permissions :
53+ id-token : write
54+
55+ steps :
56+ - name : ⬇️ Download Artifacts
57+ uses : actions/download-artifact@v4
58+ with :
59+ name : python-package-distributions
60+ path : dist/
61+
62+ - name : Publish distribution 📦 to PyPI
63+ uses : pypa/gh-action-pypi-publish@release/v1
64+
65+ publish-to-pypi :
66+ name : Publish to PyPI
67+
68+ needs : publish-to-test-pypi
69+
70+ runs-on : ubuntu-latest
71+
72+ environment :
73+ name : pypi
74+ url : https://pypi.org/p/ephys-link
75+
76+ permissions :
77+ id-token : write
78+
79+ steps :
80+ - name : ⬇️ Download Artifacts
81+ uses : actions/download-artifact@v4
82+ with :
83+ name : python-package-distributions
84+ path : dist/
85+
86+ - name : Publish distribution 📦 to PyPI
87+ uses : pypa/gh-action-pypi-publish@release/v1
88+
89+ # Build Windows executable.
90+ build-executable :
91+ name : Build Executable
92+
93+ runs-on : windows-latest
94+
95+
0 commit comments