From 915ff89c505c1dd1b091cea0b5ed5dd7cefde4ab Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sat, 5 Apr 2025 21:42:32 +0200 Subject: [PATCH] Ajouter .gitea/workflows/check-release.yaml --- .gitea/workflows/check-release.yaml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitea/workflows/check-release.yaml diff --git a/.gitea/workflows/check-release.yaml b/.gitea/workflows/check-release.yaml new file mode 100644 index 0000000..967d98e --- /dev/null +++ b/.gitea/workflows/check-release.yaml @@ -0,0 +1,49 @@ +name: Check BlueSky Crossposter version +on: + schedule: + - cron: "0 */6 * * *" + push: + branches: + - main # Changez cela si votre branche principale a un autre nom + +jobs: + check-version: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Retrieve latest BlueSky-Crossposter version + run: | + mkdir -p /tmp + git ls-remote https://github.com/Linus2punkt0/bluesky-crossposter.git HEAD \ + | cut -f 1 > /tmp/bluesky_crossposter_latest.txt + diff calibre_web_latest.txt /tmp/bluesky_crossposter_latest.txt \ + || mv /tmp/calibre_web_latest.txt bluesky_crossposter_latest.txt + shell: bash + + - name: Check if version changed + uses: stefanzweifel/git-auto-commit-action@v5 + id: auto-commit-action + commit_user_name: My Gitea Actions Bot + commit_user_email: eric@petite-maison-orange.fr + commit_author: Gitea Action + commit_message: New bluesky_crossposter_latest version avalaible + + - name: Send new version to Haoma + if: steps.auto-commit-action.outputs.changes_detected == 'true' + run: | + curl -fsS -m 10 --retry 5 \ + --data-raw "New version avalaible $(cat bluesky_crossposter_latest.txt)" \ + 'https://haoma.petite-maison-orange.fr/ping/4f109c94-61e4-4455-9bbd-629431b41ae4' + shell: bash + - name: Send no version to Haoma + if: steps.auto-commit-action.outputs.changes_detected == 'false' + run: | + curl -fsS -m 10 --retry 5 \ + --data-raw "No version avalaible stay on $(cat bluesky_crossposter_latest.txt)" \ + 'https://haoma.petite-maison-orange.fr/ping/4f109c94-61e4-4455-9bbd-629431b41ae4' + shell: bash