-
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (89 loc) · 3.11 KB
/
generate-release.yml
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
name: Generate a Release
on:
push:
tags:
- 'v[0-9].[0-9]+.[0-9]+'
- '!v[0-9].[0-9]+.[0-9]+rc[0-9]+'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
get-python-version:
name: Get Latest Python Version
runs-on: ubuntu-latest
outputs:
highest-version: ${{ steps.get-language-versions.outputs.latest-versions }}
steps:
- name: Get Required Version
uses: ActionsToolbox/get-language-versions-action@446919617fd774095b5dd3ed71c39dd3fd0d8f4f # v0.1.3
id: get-language-versions
with:
language: "python"
highest-only: true
build-and-publish:
name: Build & publish to PyPI
runs-on: ubuntu-latest
needs:
- get-python-version
steps:
- name: Checkout the Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python ${{ needs.get-python-version.outputs.highest-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ needs.get-python-version.outputs.highest-version }}
- name: Update Pip
run: python -m pip install --upgrade pip
- name: Install Required Tooling
run: pip install setuptools wheel twine
- name: Build Binary Wheel & Source Tarball
run: python setup.py sdist bdist_wheel
- name: Verify Binary Wheel & Source Tarball
run: twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
set-release-version:
name: Set Release Version
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.set-release-version.outputs.release-version }}
steps:
- name: Checkout the Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set the Release Version
id: set-release-version
run: |
echo "release-version=${GITHUB_REF#refs/*/}" >> "${GITHUB_OUTPUT}"
create-release:
name: Create a Release
permissions:
contents: write
runs-on: ubuntu-latest
needs:
- set-release-version
steps:
- name: Checkout the Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Generate Changelog
uses: Bullrich/generate-release-changelog@6b60f004b4bf12ff271603dc32dbd261965ad2f2 # v2.0.2
id: Changelog
env:
REPO: ${{ github.repository }}
- name: Create a Release
id: create_release
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref }}
name: ${{ needs.set-release-version.outputs.release-version }}
body: ${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false