Repository navigation
79 lines (72 loc) · 2.4 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (72 loc) · 2.4 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
name: Release
on:
workflow_dispatch:
inputs:
publish:
description: Publish the tested artifacts to PyPI (run from the version tag)
type: boolean
default: false
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
metadata:
name: Validate release metadata
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Validate version and changelog
env:
PUBLISH: ${{ inputs.publish }}
RELEASE_REF: ${{ github.ref }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
python3 etc/test_check_release.py
if [[ "$PUBLISH" == true ]]; then
[[ "$RELEASE_REF" == refs/tags/v* ]] || exit 1
python3 etc/check_release.py --tag "$RELEASE_TAG"
else
python3 etc/check_release.py
fi
artifacts:
needs: metadata
uses: ./.github/workflows/artifacts.yml # zizmor: ignore[self-repository] Keep the same-commit syntax supported by actionlint 1.7.12.
validate:
name: Validate complete release set
needs: artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download tested artifacts
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: dist
merge-multiple: true
- name: Validate distributions
run: python3 etc/check_release.py --dist dist
publish:
name: Publish to PyPI
if: inputs.publish
needs: validate
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/GixPython/
permissions:
id-token: write # Authenticate this approved release with PyPI Trusted Publishing.
steps:
- name: Download tested artifacts
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: dist
merge-multiple: true
- name: Publish distributions with attestations
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.2; commit SHA, required for its GHCR image tag.