From 49bc46cfa9bdaec174cde4dfe048b836a6fef564 Mon Sep 17 00:00:00 2001 From: Quentin BOUTEILLER Date: Sun, 17 May 2026 18:20:43 +0200 Subject: [PATCH] ci: try to automate release --- .gitea/workflows/check-upstream.yaml | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .gitea/workflows/check-upstream.yaml diff --git a/.gitea/workflows/check-upstream.yaml b/.gitea/workflows/check-upstream.yaml new file mode 100644 index 0000000..c781363 --- /dev/null +++ b/.gitea/workflows/check-upstream.yaml @@ -0,0 +1,47 @@ +name: Check for a new Akkoma release + +on: + schedule: + - cron: '2 * * * *' + +jobs: + check-releases: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Extract latest version from Akkoma forge + run: | + set -e # Fail on error + LATEST_VERSION=$(curl -s https://akkoma.dev/AkkomaGang/akkoma/tags.rss | \ + grep 'https://akkoma.dev/AkkomaGang/akkoma/releases/tag/' | \ + head -n 1 | rev | cut -d '/' -f 2 | rev | cut -d '<' -f 1) + LATEST_VERSION=${LATEST_VERSION#v} + echo "Latest Akkoma version: $LATEST_VERSION" + echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV + + - name: Check if tag exists + id: check + run: | + if git rev-parse "v${LATEST_VERSION}" >/dev/null 2>&1 + then + echo "Tag v${LATEST_VERSION} already exists." + echo "new_version=false" >> $GITHUB_OUTPUT + else + echo "New version detected: ${LATEST_VERSION}" + echo "new_version=true" >> $GITHUB_OUTPUT + fi + + - name: Configure Git + run: | + git config user.name "Gitea Actions" + git config user.email "actions@git.quent1.fr" + git remote set-url origin "https://${{ secrets.GITEA_TOKEN }}@git.quent1.fr/${{ github.repository }}" + + - name: Create and push new tag + if: steps.check.outputs.new_version == 'true' + run: | + git tag "v${LATEST_VERSION}" + git push origin "v${LATEST_VERSION}"