Repository navigation
117 lines (117 loc) · 4.3 KB
/
Copy pathrelease.yaml
File metadata and controls
117 lines (117 loc) · 4.3 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: 🚀 Release to PyPI
on:
push:
tags: ["*"]
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: 🏗️ Build
uses: tox-dev/github-workflows/.github/workflows/validate-python-release.yaml@57a765127aae73adf7d0e24a7fe0f067f2d3ea3e # 6.2.1
permissions:
contents: read
notes:
name: 📝 Render GitHub Release notes
runs-on: ubuntu-26.04
permissions:
contents: read
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
steps:
- name: 📥 Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: 🐍 Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: 📦 Install locked release tools
uses: tox-dev/github-workflows/install-locked-tools@57a765127aae73adf7d0e24a7fe0f067f2d3ea3e # 6.2.1
with:
groups: release-notes
venv: ${{ runner.temp }}/release-tools
- name: 🏷️ Select previous tag
id: previous
uses: tox-dev/github-workflows/select-previous-tag@57a765127aae73adf7d0e24a7fe0f067f2d3ea3e # 6.2.1
with:
tag: ${{ github.ref_name }}
- name: 📝 Render release notes
uses: tox-dev/github-workflows/render-release-notes@57a765127aae73adf7d0e24a7fe0f067f2d3ea3e # 6.2.1
with:
tag: ${{ github.ref_name }}
previous: ${{ steps.previous.outputs.previous }}
changelog: docs/changelog.rst
artifact-url: https://pypi.org/project/python-discovery/${{ github.ref_name }}/
- name: 📤 Upload release notes
id: upload
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-notes
path: ${{ runner.temp }}/release-notes.md
if-no-files-found: error
release:
name: 🚀 Publish to PyPI
needs: [build, notes]
runs-on: ubuntu-26.04
environment:
name: release
url: https://pypi.org/project/python-discovery/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: 📩 Download distributions
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
artifact-ids: ${{ needs.build.outputs.distributions-artifact-id }}
path: dist/
- name: 🚀 Publish to PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
packages-dir: dist
github-release:
name: 🚀 Publish GitHub Release
needs: [build, notes, release]
runs-on: ubuntu-26.04
environment: release
permissions:
contents: write
steps:
- name: 🐍 Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: latest-known
python-version: "3.15"
enable-cache: false
ignore-empty-workdir: true
- name: 📩 Download distributions
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
artifact-ids: ${{ needs.build.outputs.distributions-artifact-id }}
path: dist/
- name: 📩 Download release notes
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
artifact-ids: ${{ needs.notes.outputs.artifact-id }}
path: ${{ runner.temp }}
- name: 🔍 Verify PyPI artifacts
uses: tox-dev/github-workflows/reconcile-pypi-artifacts@57a765127aae73adf7d0e24a7fe0f067f2d3ea3e # 6.2.1
with:
project: python-discovery
version: ${{ github.ref_name }}
dist: dist
- name: 🚀 Publish GitHub release
uses: tox-dev/github-workflows/publish-github-release@57a765127aae73adf7d0e24a7fe0f067f2d3ea3e # 6.2.1
env:
GH_TOKEN: ${{ github.token }}
with:
tag: ${{ github.ref_name }}
commit: ${{ github.sha }}
title: v${{ github.ref_name }}
notes-file: ${{ runner.temp }}/release-notes.md