Skip to content

Mint release 🍬

Mint release 🍬 #3

Workflow file for this run

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@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install pre-commit ruamel.yaml
- name: Configure git
run: |
git config --global user.email "[email protected]"
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