forked from Snazzah/davey
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (81 loc) · 2.43 KB
/
python-release.yml
File metadata and controls
88 lines (81 loc) · 2.43 KB
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
80
81
82
83
84
85
86
87
88
name: "[davey-python] Release to PyPI"
on:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Build and test
uses: ./.github/workflows/python-test.yml
secrets: inherit
get_version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.current_version }}
defaults:
run:
working-directory: davey-python
steps:
- uses: actions/checkout@v5
- name: Use Python
uses: actions/setup-python@v6
with:
python-version: 3.x
- uses: astral-sh/setup-uv@v6
- name: Get current version
id: get_version
run: |
version="$(uvx --from=toml-cli toml get --toml-path=Cargo.toml package.version)"
version="${version/-pre./rc}"
echo "current_version=${version}" >> "$GITHUB_OUTPUT"
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
defaults:
run:
working-directory: davey-python
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: 'wheels-*/*'
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
release:
name: Create release
needs: [get_version, publish]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: cliff.toml
args: --unreleased --strip all --ignore-tags="(js|rs)-*" --include-path="./davey-python/**" --include-path="./davey/**"
env:
OUTPUT: davey-python/CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: "py-${{ needs.get_version.outputs.version }}"
name: "davey-python@${{ needs.get_version.outputs.version }}"
target_commitish: ${{ github.sha }}
body_path: davey-python/CHANGELOG.md