-
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (67 loc) · 1.9 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
# THIS FILE IS GENERATED! DO NOT EDIT! Maintained by Pulumi
name: python release
on:
push:
tags:
- '*'
permissions:
contents: write
id-token: write
jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a changelog
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
config: .github/cliff.toml
args: -vv --current
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
create_draft_release:
name: Create release as draft
runs-on: ubuntu-latest
needs: [changelog]
steps:
- name: Create release as draft
run: gh release create ${{ github.ref_name }} -F ${{ needs.changelog.outputs.release_body }} --draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package:
name: Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras
- name: Publish package
run: |
sed -i -e "s/0.0.0/${GITHUB_REF#refs/*/}/" pyproject.toml
uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish_release:
name: Publish release
runs-on: ubuntu-latest
needs: [create_draft_release, changelog, package]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release
run: gh release edit ${{ github.ref_name }} --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}