From 409817ca6333da62e87a71b4d3c2d0713263f380 Mon Sep 17 00:00:00 2001 From: Peter Njeim Date: Thu, 8 Sep 2022 16:40:44 -0300 Subject: [PATCH] Create update.yaml --- .github/workflows/update.yaml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/update.yaml diff --git a/.github/workflows/update.yaml b/.github/workflows/update.yaml new file mode 100644 index 0000000..3be6b99 --- /dev/null +++ b/.github/workflows/update.yaml @@ -0,0 +1,44 @@ +name: Update MagiskOnWSA +on: + schedule: + - cron: "0 0 * * 0" + workflow_dispatch: + +permissions: + contents: write + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Rename tag + run: | + URL="$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/latest | jq -r .url)" + curl -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $URL -d '{"tag_name":"outdated"}' + - name: Delete tag + run: | + curl -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/git/refs/tags/latest + - name: Update MagiskOnWSA + run: | + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"None","gapps_var":"None","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"None","gapps_var":"Pico","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"None","gapps_var":"Full","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"Stable","gapps_var":"None","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"Stable","gapps_var":"Pico","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"Stable","gapps_var":"Full","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"Canary","gapps_var":"None","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"Canary","gapps_var":"Pico","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"x86_64","magisk_ver":"Canary","gapps_var":"Full","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"ARM64","magisk_ver":"None","gapps_var":"None","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"ARM64","magisk_ver":"None","gapps_var":"Pico","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"ARM64","magisk_ver":"Stable","gapps_var":"None","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"ARM64","magisk_ver":"Stable","gapps_var":"Pico","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"ARM64","magisk_ver":"Canary","gapps_var":"None","tag":"latest","prerelease":true}}' + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yaml/dispatches -d '{"ref":"master","inputs":{"arch":"ARM64","magisk_ver":"Canary","gapps_var":"Pico","tag":"latest","prerelease":true}}' + - name: Publish release + run: | + URL="$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/latest | jq -r .url)" + curl -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $URL -d '{"prerelease":false}' + - name: Delete release + run: | + curl -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/git/refs/tags/outdated