From 5fd3987e0efeede6f674190e886102b8f24d605f Mon Sep 17 00:00:00 2001 From: Mindfang Date: Tue, 4 Jun 2024 11:06:39 -0500 Subject: [PATCH] Add release monitoring --- .dockerignore | 3 ++- .gitea/workflows/monitor.yaml | 33 +++++++++++++++++++++++++++++++++ release-versions/latest.txt | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/monitor.yaml create mode 100644 release-versions/latest.txt diff --git a/.dockerignore b/.dockerignore index 3787a26..e48e9a9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ .gitignore README.md -docker-compose.yml \ No newline at end of file +docker-compose.yml +release-versions \ No newline at end of file diff --git a/.gitea/workflows/monitor.yaml b/.gitea/workflows/monitor.yaml new file mode 100644 index 0000000..4ed87f6 --- /dev/null +++ b/.gitea/workflows/monitor.yaml @@ -0,0 +1,33 @@ +name: Get latest release version +on: + schedule: + - cron: "30 * * * *" + +env: + MONITOR_URL: "https://api.github.com/repos/pterodactyl/wings/releases/latest" + +jobs: + get-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.REPO_MOD_TOKEN }} + - name: Prepare the container + run: apt-get update && apt-get --no-install-recommends -y install jq + - name: Fetch release version + id: version-check + run: | + VERSION_TAG=$(curl -sL $MONITOR_URL | jq -r .tag_name) + echo "$VERSION_TAG" > release-versions/latest.txt + echo ::set-output name=version::"$VERSION_TAG" + - name: Check for modified files + id: git-check + run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") + - name: Commit latest release version + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'Actions' + git config --global user.email 'noreply@taco.quest' + git commit -am "Trigger new release autobuild for ${{ steps.version-check.outputs.version }}" + git push diff --git a/release-versions/latest.txt b/release-versions/latest.txt new file mode 100644 index 0000000..77418c8 --- /dev/null +++ b/release-versions/latest.txt @@ -0,0 +1 @@ +v1.11.7