From 102232ea4a771d2e092546aa6c4ad1984a51ba35 Mon Sep 17 00:00:00 2001 From: Pikatsuto Date: Wed, 26 Jun 2024 00:36:50 +0200 Subject: [PATCH] feat: add chanel switching action --- .github/workflows/auto_nigthly.yml | 33 ++++++++++++++++++++++++++++++ .github/workflows/auto_release.yml | 33 ++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/auto_nigthly.yml create mode 100644 .github/workflows/auto_release.yml diff --git a/.github/workflows/auto_nigthly.yml b/.github/workflows/auto_nigthly.yml new file mode 100644 index 0000000..444b6d1 --- /dev/null +++ b/.github/workflows/auto_nigthly.yml @@ -0,0 +1,33 @@ +on: + workflow_dispatch + +jobs: + auto_nightly: + name: convert testing to nightly + runs-on: ubuntu-22.04 + steps: + - name: pr_all_to_nightly + run: | + QUERY_RESULT=$( + curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.RevoluNixPKGS_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/search/repositories?q=pkg+user:RevoluNix" + ) + PACKAGES_REPOSITROYS=$( + echo $QUERY_RESULT \ + | jq -r '.items.[].full_name' + ) + + for REPOSITORY in "${PACKAGES_REPOSITROYS}"; do + gh pr create \ + -R ${REPOSITORY} \ + --head testing \ + --base nightly \ + --title "Switch testing chanel to nightly" + gh pr merge nightly \ + -R ${REPOSITORY} \ + -s \ + --auto + done diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml new file mode 100644 index 0000000..7221547 --- /dev/null +++ b/.github/workflows/auto_release.yml @@ -0,0 +1,33 @@ +on: + workflow_dispatch + +jobs: + auto_release: + name: convert nightly to release + runs-on: ubuntu-22.04 + steps: + - name: pr_all_to_release + run: | + QUERY_RESULT=$( + curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.RevoluNixPKGS_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/search/repositories?q=pkg+user:RevoluNix" + ) + PACKAGES_REPOSITROYS=$( + echo $QUERY_RESULT \ + | jq -r '.items.[].full_name' + ) + + for REPOSITORY in "${PACKAGES_REPOSITROYS}"; do + gh pr create \ + -R ${REPOSITORY} \ + --head nightly \ + --base main \ + --title "Switch nightly chanel to main" + gh pr merge main \ + -R ${REPOSITORY} \ + -s \ + --auto + done