This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 90
79 lines (67 loc) · 1.75 KB
/
release.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build release distributions
run: |
just ci-install
just build
- name: upload dists
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
publish-pypi:
runs-on: ubuntu-latest
name: Publish to PyPI
if: "startsWith(github.ref, 'refs/tags/')"
needs:
- release-build
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish-release:
runs-on: ubuntu-latest
name: Publish to GitHub
if: "startsWith(github.ref, 'refs/tags/')"
needs:
- release-build
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Get tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Publish to GitHub
uses: softprops/action-gh-release@v2
with:
draft: true
files: dist/*
tag_name: ${{ env.RELEASE_VERSION }}