-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (47 loc) · 1.23 KB
/
build.yml
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
name: Build
on:
pull_request:
push:
branches:
- main
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
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: Check package
run: pixi run -e build check-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@8a08d616893759ef8e1aa1f2785787c0b97e20d6
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6