Repository navigation
88 lines (88 loc) · 2.88 KB
/
Copy pathrelease.yaml
File metadata and controls
88 lines (88 loc) · 2.88 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: "🚀 Release to PyPI"
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: read
env:
dists-artifact-name: python-package-distributions
jobs:
build:
name: "🏗️ Build distributions"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-26.04
permissions:
contents: read
steps:
- name: "📥 Check out code"
uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: "🐍 Install uv"
uses: astral-sh/setup-uv@v10.3.3
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: "🏗️ Build distributions"
uses: tox-dev/github-workflows/build-python-distribution@6.8.4
- name: "📤 Upload distributions"
uses: actions/upload-artifact@v7.0.2
with:
name: ${{ env.dists-artifact-name }}
path: dist/*
if-no-files-found: error
tag-build:
name: 🏗️ Build
if: startsWith(github.ref, 'refs/tags/')
uses: tox-dev/github-workflows/.github/workflows/validate-python-release.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
permissions:
contents: read
github-notes:
name: "📝 Render GitHub Release notes"
if: startsWith(github.ref, 'refs/tags/')
uses: tox-dev/github-workflows/.github/workflows/release-notes.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
permissions:
contents: read
with:
tag: ${{ github.ref_name }}
changelog: docs/changelog.rst
artifact-url: https://pypi.org/project/filelock/${{ github.ref_name }}/
publish:
name: "🚀 Publish to PyPI"
needs: [tag-build, github-notes]
runs-on: ubuntu-26.04
environment:
name: release
url: https://pypi.org/project/filelock/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: "📩 Download distributions"
uses: actions/download-artifact@v8.0.2
with:
artifact-ids: ${{ needs.tag-build.outputs.distributions-artifact-id }}
path: dist/
- name: "🚀 Publish to PyPI"
uses: pypa/gh-action-pypi-publish@v1.14.3
with:
packages-dir: dist
github-release:
name: "🚀 Publish GitHub Release"
needs: [tag-build, publish, github-notes]
if: startsWith(github.ref, 'refs/tags/')
uses: tox-dev/github-workflows/.github/workflows/github-release.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
permissions:
contents: write
with:
project: filelock
version: ${{ github.ref_name }}
tag: ${{ github.ref_name }}
artifact-pattern: python-package-distributions
notes-artifact-id: ${{ needs.github-notes.outputs.artifact-id }}