Repository navigation
62 lines (57 loc) · 1.57 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (57 loc) · 1.57 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
---
# Publishes to PyPI when a vX.Y.Z tag is pushed, with PyPI trusted publishing (no
# token stored in GitHub). Before the first release, add a pending publisher on pypi.org:
# project libcloud-noderings, owner noderings, repository libcloud-noderings,
# workflow release.yml, environment pypi
name: release
"on":
push:
tags: ["v*.*.*"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: pip install build && python -m build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
pypi:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
github-release:
needs: pypi
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Attest build provenance
uses: actions/attest-build-provenance@v4
with:
subject-path: dist/*
- env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" --notes "See CHANGELOG.md."