-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (56 loc) · 1.53 KB
/
release.yaml
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
---
name: "Release"
on: # yamllint disable-line
release:
types:
- "published"
jobs:
build:
name: "Build package with poetry"
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
runs-on: "ubuntu-24.04"
steps:
- uses: "actions/checkout@v4"
- name: "Install uv"
uses: "astral-sh/setup-uv@v5"
with:
version: "0.6.4"
- name: "Build package"
run: "uv build"
- name: "Cache build artifacts"
uses: "actions/upload-artifact@v4"
with:
name: "distfiles"
path: "dist/"
if-no-files-found: "error"
publish-github:
name: "Upload to GitHub Release"
runs-on: "ubuntu-24.04"
permissions:
contents: "write"
needs: "build"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/download-artifact@v4"
with:
name: "distfiles"
path: "dist/"
- run: "gh release upload ${{ github.event.release.tag_name }} dist/*.{tar.gz,whl}"
env:
GH_TOKEN: "${{ github.token }}"
publish-pypi:
name: "Upload to PyPI"
runs-on: "ubuntu-24.04"
environment:
name: "pypi"
url: "https://pypi.org/p/mkdocs-ansible-collection"
permissions:
id-token: "write"
needs: "build"
steps:
- uses: "actions/download-artifact@v4"
with:
name: "distfiles"
path: "dist/"
- name: "Publish package distributions to PyPI"
uses: "pypa/gh-action-pypi-publish@release/v1"