Repository navigation
63 lines (58 loc) · 1.74 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (58 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Upload a Python Package using Twine when a release is created
name: Build
on: # yamllint disable-line rule:truthy
release:
types: [published]
push:
branches: ["main", "maint/*"]
permissions:
contents: read
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-python@v7.0.0
- name: Install dependencies
run: |
python -m pip install --upgrade pip packaging build twine
- run: python -m build --sdist --wheel
- run: twine check --strict dist/*
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist
pypi-upload:
needs: package
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
id-token: write # for trusted publishing
environment:
name: pypi
url: https://pypi.org/p/mne
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release'
# Asks the conda-forge bot to open the version-bump PR on the feedstock right
# away rather than waiting for its next scheduled scan
conda-forge:
needs: pypi-upload
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions: {}
env:
GH_TOKEN: ${{ secrets.MNE_BOT_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
steps:
- run: |
gh issue create --repo conda-forge/mne-feedstock \
--title "@conda-forge-admin, please update version" \
--body "mne-tools/mne-python ${TAG} has been released and uploaded to PyPI."