-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (49 loc) · 1.4 KB
/
release.yml
File metadata and controls
62 lines (49 loc) · 1.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
name: PyPi Release
on:
push:
tags:
- "*"
permissions:
contents: read
jobs:
pypi-publish:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build package
run: |
python -m build
- name: Check metadata
run: twine check dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
runs-on: ubuntu-latest
name: GitHub release
environment: release
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Get release version
id: get_version
uses: actions/github-script@v7
with:
script: core.setOutput('version', context.ref.replace("refs/tags/", ""))
- name: Create GitHub release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: "v${{ steps.get_version.outputs.version }}"
body: "Notes: https://python-cmake.github.io/pytest-cmake/release/release_notes.html"