From a9c87f2adfb73373d186adc507e8558ba3eda412 Mon Sep 17 00:00:00 2001 From: jondale Date: Thu, 22 Jan 2026 09:58:10 -0500 Subject: [PATCH] create version file for future use --- .gitea/workflows/version.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/version.yml diff --git a/.gitea/workflows/version.yml b/.gitea/workflows/version.yml new file mode 100644 index 0000000..ba7558a --- /dev/null +++ b/.gitea/workflows/version.yml @@ -0,0 +1,45 @@ +name: version + +on: + release: + types: [published] + +jobs: + update-version: + runs-on: [ubuntu-24.04] + steps: + - name: Checkout repository + run: | + set -euo pipefail + rm -rf .git || true + rm -rf ./* ./.??* || true + git clone --depth 1 https://git.knoxmakers.org/KnoxMakers/knoxmakers-inkscape.git . + git checkout main + + - name: Configure git identity + run: | + git config user.name "haxbot" + git config user.email "haxbot@knoxmakers.sh" + + - name: Write version file + run: | + echo "${{ gitea.event.release.name }}" > version + + - name: Commit and push version file + env: + HAXBOT_TOKEN: ${{ secrets.HAXBOT_TOKEN }} + run: | + set -euo pipefail + + git add version + + if git diff --cached --quiet; then + echo "No changes to version file" + exit 0 + fi + + git commit -m "version: ${{ gitea.event.release.name }}" + + REPO_URL="https://x-access-token:${HAXBOT_TOKEN}@git.knoxmakers.org/KnoxMakers/knoxmakers-inkscape.git" + git remote set-url origin "$REPO_URL" + git push origin HEAD:main