ci: autogen-banner #118

Merged
servostar merged 8 commits from ci/autogen-banner into main 2024-11-30 19:04:14 +00:00
1 changed files with 26 additions and 9 deletions
Showing only changes of commit 1f031c050f - Show all commits

View File

@ -12,27 +12,44 @@ jobs:
env:
USERNAME: servostar
EMAIL: sven.vogel123@web.de
GIT_AUTH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
ref: 'main'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Tag Release Commit
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GIT_AUTH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Install dependencies for Nix setup action
run: |
apt update -y
apt install sudo -y
- name: Setup Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Setup Git
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"
- name: Update Typst.toml
run: |
export VERSION=$(echo "${COMMIT_MESSAGE}" | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+')
sed -i "/version/c\version = \"${VERSION#v}\"" typst.toml
git add typst.toml
git commit -m "chore: bump release version to $VERSION" -m "Generated-By: ${{ gitea.actor }}"
- name: Generate Example Document
run: nix-shell --run ./run-ci.sh
- name: Generate Assets
if: contains(github.event.head_commit.message, 'Generate-Assets')
run: |
./run-bake-assets.sh
git add assets/banner.png
git add assets/page-preview.png
git commit -m "chore: update assets" -m "Generated-By: ${{ gitea.actor }}"
- name: Tag and Push Changes
run: |
git push origin main
echo "::endgroup::"
echo "::group::{Tag commit}"
export VERSION=$(echo "${COMMIT_MESSAGE}" | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+')
git tag -m "Release" "${VERSION}"
git push origin "${VERSION}"
echo "::endgroup::"