Skip to content

Commit

Permalink
Merge pull request #64 from schmidtfa/prepare_release
Browse files Browse the repository at this point in the history
Add release and publish logic
  • Loading branch information
schmidtfa authored Oct 3, 2024
2 parents 373acbc + 4fbbba9 commit a2af83b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
61 changes: 60 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- main
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -53,4 +56,60 @@ jobs:
cache: true
locked: false
frozen: false
- run: pixi run -e mne check_types
- run: pixi run -e mne check_types

build:
runs-on: ubuntu-latest
if: ${{ github.ref_type == 'tag' }}
needs: [test, lint, type_check]
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: latest
cache: true
locked: false
frozen: false
- run: pixi run hatch build
- uses: actions/upload-artifact@v4
with:
name: pyrasa_dist
path: dist/

publish_to_testpypi:
runs-on: ubuntu-latest
if: ${{ contains(github.ref, 'dev') }}
needs: [build]
environment:
name: testpypi
url: https://test.pypi.org/p/pyrasa
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: pyrasa_dist
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish_to_pypi:
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, 'dev') }}
needs: [build]
environment:
name: pypi
url: https://pypi.org/p/pyrasa
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: pyrasa_dist
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ test = "pytest --cov=pyrasa --cov-report=lcov"
lint = "ruff format && ruff check --fix"
lint_ci = "ruff check"
check_types = "mypy pyrasa tests"
version_minor = "hatch version minor && hatch version dev"
version_fix = "hatch version fix && hatch version dev"
doc_dev = "sphinx-autobuild --ignore 'doc/source/auto_examples/*' doc/source doc/build"
build_docs = "cd doc; make clean; make html"

Expand Down
2 changes: 1 addition & 1 deletion pyrasa/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version information for Pyrasa."""

__version__ = '0.1.0.dev0'
__version__ = '0.2.1.dev0'

0 comments on commit a2af83b

Please sign in to comment.