ci: update prepare workflow to bake assets on Generate-Assets
Build'n check / run-ci-linux (push) Has been skipped Details

This commit is contained in:
Sven Vogel 2024-11-30 18:16:57 +01:00
parent 4513d993b4
commit 1f031c050f
1 changed files with 26 additions and 9 deletions

View File

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