-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.09 KB
/
publish.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
name: Publish
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
publish:
name: "Publish release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Pixi Python Project
uses: prefix-dev/[email protected]
with:
pixi-version: v0.28.2
cache: true
environments: dev # separate by spaces; only using the dev environment to build
- name: Install twine from conda-forge (globally as to not interfere)
run: pixi global install twine
- name: Build package
run: pixi run -e dev build
- name: Publish to PyPI
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# Create GitHub release
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" ./dist/* \
--repo="$GITHUB_REPOSITORY" \
--generate-notes