-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (41 loc) · 1.34 KB
/
mint-release.yml
File metadata and controls
52 lines (41 loc) · 1.34 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
name: Mint release 🍬
on:
workflow_dispatch:
inputs:
tag:
description: Release tag 🏷️
required: true
default: 0.1.0rc1
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install pre-commit ruamel.yaml
- name: Configure git
run: |
git config --global user.email "team@plasmapy.org"
git config --global user.name "PlasmaPy Release Bot"
- name: Create or checkout branch
run: |
VERSION="v${{ github.event.inputs.tag }}"
BRANCH=$(echo $VERSION | awk 'BEGIN{FS=OFS="."} {$3="x"} 1' | cut -f1,2,3 -d'.' | awk -F'rc' '{print $1 ORS $2}')
git checkout $BRANCH 2>/dev/null || git checkout -b $BRANCH
- name: Tag the release
run: |
git tag "v${{ github.event.inputs.tag }}" -m "Version v${{ github.event.inputs.tag }}"
git tag
- name: Push tag, branch state
run: |
VERSION="v${{ github.event.inputs.tag }}"
BRANCH=$(echo $VERSION | awk 'BEGIN{FS=OFS="."} {$3="x"} 1' | cut -f1,2,3 -d'.' | awk -F'rc' '{print $1 ORS $2}')
git push -u origin $VERSION $BRANCH