Skip to content

Commit 70b9ef1

Browse files
committed
Automate release process
1 parent 10fd755 commit 70b9ef1

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

.github/workflows/workflow.yml renamed to .github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pslab-python
1+
name: lint
22

33
on:
44
- push

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
pypi-publish:
10+
runs-on: ubuntu-latest
11+
12+
environment: pypi
13+
14+
permissions:
15+
id-token: write
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: build wheel and sdist
21+
run: |
22+
pip install "flit>=3.2.0,<4.0.0"
23+
flit build
24+
25+
- name: publish
26+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Draft release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
set-body:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- run: sudo apt install pcregrep
14+
15+
- uses: actions/checkout@v4
16+
17+
- name: Parse changelog
18+
id: parse-changelog
19+
run: |
20+
tag='${{ github.ref_name }}'
21+
re_current_tag="## \[$tag\].*\n\n" # Match, but do not capture, current version tag, then...
22+
re_changes_body='((.|\n)+?)' # capture everything including newlines...
23+
re_previous_tag='## \[[0-9]+.[0-9]+.[0-9]+\]' # until previous version tag.
24+
re_full="${re_current_tag}${re_changes_body}${re_previous_tag}"
25+
echo 'match<<EOF' >> $GITHUB_OUTPUT
26+
# Match multiple lines, output capture group 1.
27+
pcregrep -M -o1 "$re_full" ./CHANGELOG.md >> $GITHUB_OUTPUT
28+
echo 'EOF' >> $GITHUB_OUTPUT
29+
30+
- name: Set release body
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
draft: true
34+
body: ${{ steps.parse-changelog.outputs.match }}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy