Skip to content

Commit

Permalink
Add build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Jun 10, 2024
1 parent 84c469d commit 4e8d6ce
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build
on:
push:
branches:
- main
tags:
- "*"
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: build
- name: Build project
run: pixi run -e build build-wheel
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: artifact
path: dist/*

release:
name: Publish package
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish package on TestPyPi
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
6 changes: 6 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ nbsphinx = "*"
[feature.docs.tasks]
docs = "cd docs && make html"

[feature.build.dependencies]
build = "*"
[feature.build.tasks]
build-wheel = "python -m build --no-isolation ."

[feature.test.dependencies]
pytest = ">=6"
pytest-cov = "*"
Expand Down Expand Up @@ -72,4 +77,5 @@ py310 = ["py310", "test"]
py311 = ["py311", "test"]
py312 = ["py312", "test"]
docs = ["docs"]
build = { features = ["build"], no-default-feature = true }
lint = { features = ["lint"], no-default-feature = true }

0 comments on commit 4e8d6ce

Please sign in to comment.