File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ # Upload a Python Package using Twine when a release is created
2+
3+ name : Build
4+ on : # yamllint disable-line rule:truthy
5+ release :
6+ types : [published]
7+ push :
8+ branches :
9+ - main
10+ pull_request :
11+ branches :
12+ - main
13+
14+ permissions :
15+ contents : read
16+
17+ jobs :
18+ package :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v3
22+ - uses : actions/setup-python@v4
23+ with :
24+ python-version : ' 3.10'
25+ - name : Install dependencies
26+ run : |
27+ python -m pip install --upgrade pip
28+ pip install build twine
29+ - run : python -m build --sdist --wheel
30+ - run : twine check --strict dist/*
31+ - uses : actions/upload-artifact@v3
32+ with :
33+ name : dist
34+ path : dist
35+
36+ pypi-upload :
37+ needs : package
38+ runs-on : ubuntu-latest
39+ if : github.event_name == 'release'
40+ permissions :
41+ id-token : write # for trusted publishing
42+ environment :
43+ name : pypi
44+ url : https://pypi.org/p/mne
45+ steps :
46+ - uses : actions/download-artifact@v3
47+ with :
48+ name : dist
49+ path : dist
50+ - uses : pypa/gh-action-pypi-publish@release/v1
51+ if : github.event_name == 'release'
You can’t perform that action at this time.
0 commit comments