Skip to content

Master Release

Master Release #5

name: Master Release
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: Choose which type of release to perform.
options:
- major
- minor
- patch
default: patch
jobs:
release-master:
runs-on: ubuntu-latest
steps:
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_TOKEN }}
- name: Check Out Repo
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: nightly
fetch-depth: 0
- name: Create Release Commit and Synchronize Branches
run: |
value=$(cat VERSION)
version="${value%-build*}"
echo "CURRENT_VERSION: '${version}'"
IFS='.' read -r MAJOR MINOR PATCH <<< "$version"
if [[ "${{ github.event.inputs.release_type }}" == "major" ]]; then
NEW_VERSION="$((MAJOR+1)).0.0"
elif [[ "${{ github.event.inputs.release_type }}" == "minor" ]]; then
NEW_VERSION="${MAJOR}.$((MINOR+1)).0"
else
NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH+1))"
fi
echo "NEW_VERSION='${NEW_VERSION}'"
echo "new_ver=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "$NEW_VERSION" > "VERSION"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add VERSION
git commit -m "Kometa Release ${NEW_VERSION}"
git push origin nightly
git push origin refs/heads/nightly:refs/heads/develop
git push origin refs/heads/nightly:refs/heads/main