From f1422b65414aadd66799a6aeeac97777417091e8 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:14:18 -0600 Subject: [PATCH] CI: make alpine releases reuse open draft MRs --- .github/workflows/release.yml | 3 ++- scripts/release-alpine.sh | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ec585cbc5..ccd797e4b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -255,10 +255,11 @@ jobs: formula: rtx bump-alpine: runs-on: ubuntu-22.04 - if: startsWith(github.event.ref, 'refs/tags/v') container: ghcr.io/jdx/rtx:alpine timeout-minutes: 30 needs: [release] + env: + DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }} steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/scripts/release-alpine.sh b/scripts/release-alpine.sh index b814069bf0..c14b00e4f3 100755 --- a/scripts/release-alpine.sh +++ b/scripts/release-alpine.sh @@ -27,10 +27,19 @@ abuild -r apkbuild-lint APKBUILD git add APKBUILD -git checkout -B "rtx/${RTX_VERSION#v}" +git checkout -B rtx git commit -m "community/rtx: upgrade to ${RTX_VERSION#v}" git remote add jdxcode "https://jdxcode:$GITLAB_TOKEN@gitlab.alpinelinux.org/jdxcode/aports.git" -git push -f jdxcode -#glab mr create --draft --fill --yes -H jdxcode/aports -R alpine/aports + +if [ "$DRY_RUN" == 0 ]; then + git push -f jdxcode +fi + +open_mr="$(gitlab mr list -R alpine/aports --author=@me)" +if [[ "$open_mr" != "Showing"* ]]; then + if [ "$DRY_RUN" == 0 ]; then + glab mr create --draft --fill --yes -H jdxcode/aports -R alpine/aports + fi +fi #git show