2024-11-25 13:35:37 +00:00
|
|
|
name: Create Release Commit
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags-ignore:
|
|
|
|
- v*.*.*
|
|
|
|
jobs:
|
|
|
|
prepare:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: contains(github.event.head_commit.message, 'Release-As:')
|
|
|
|
env:
|
|
|
|
USERNAME: servostar
|
|
|
|
EMAIL: sven.vogel123@web.de
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
2024-11-25 14:50:39 +00:00
|
|
|
ref: 'main'
|
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
2024-11-25 13:35:37 +00:00
|
|
|
- name: Tag Release Commit
|
|
|
|
env:
|
2024-11-25 14:50:39 +00:00
|
|
|
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
|
|
|
GIT_AUTH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
2024-11-25 13:35:37 +00:00
|
|
|
run: |
|
|
|
|
export VERSION=$(echo "${COMMIT_MESSAGE}" | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+')
|
|
|
|
git config --global user.name "${USERNAME}"
|
|
|
|
git config --global user.email "${EMAIL}"
|
|
|
|
echo "==> Update typst.toml version"
|
|
|
|
sed -i "/version/c\version = \"${VERSION#v}\"" typst.toml
|
|
|
|
git add typst.toml
|
|
|
|
git commit -m "chore: bump release version to $VERSION"
|
2024-11-25 13:56:06 +00:00
|
|
|
git push origin main
|
2024-11-25 13:35:37 +00:00
|
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::{Tag commit}"
|
|
|
|
git tag -m "Release" "${VERSION}"
|
2024-11-25 13:56:06 +00:00
|
|
|
git push origin "${VERSION}"
|
2024-11-25 13:35:37 +00:00
|
|
|
echo "::endgroup::"
|