Skip to content

Commit

Permalink
MAINT: Use PyPI upload action for published releases
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Sep 30, 2023
1 parent d52a0d3 commit 09f968d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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
pull_request:
branches:
- main

jobs:
package:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mne
permissions:
id-token: write # for trusted publishing
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- run: python -m build --sdist --wheel
- run: twine check --strict dist/*
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release'

0 comments on commit 09f968d

Please sign in to comment.