From 151c7ea2ed1ba1242924474ddc3125368c0c48ba Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:50:08 -0600 Subject: [PATCH] CI: separate aur scripts --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++---------- scripts/release-aur-bin.sh | 6 +++++- scripts/release-aur.sh | 6 +++++- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ccf50c9d98..343179250c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ concurrency: env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: 0 + DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }} jobs: build-tarball: @@ -181,8 +182,6 @@ jobs: - build-tarball - rpm - deb - env: - DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }} steps: - uses: actions/checkout@v4 with: @@ -234,12 +233,6 @@ jobs: files: releases/${{github.ref_name}}/* generate_release_notes: true token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }} - - name: Release to aur - run: scripts/release-aur.sh - working-directory: rtx - - name: Release aur-bin - run: scripts/release-aur-bin.sh - working-directory: rtx bump-homebrew-formula: runs-on: macos-latest if: startsWith(github.event.ref, 'refs/tags/v') @@ -254,13 +247,37 @@ jobs: with: token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }} formula: rtx + bump-aur: + runs-on: ubuntu-22.04 + timeout-minutes: 30 + needs: [e2e-linux] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.RTX_SSH_KEY }} + known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }} + - name: Bump aur + run: ./scripts/release-aur.sh + bump-aur-bin: + runs-on: ubuntu-22.04 + timeout-minutes: 30 + needs: [e2e-linux] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.RTX_SSH_KEY }} + known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }} + - name: Bump aur-bin + run: ./scripts/release-aur-bin.sh bump-alpine: runs-on: ubuntu-22.04 container: ghcr.io/jdx/rtx:alpine timeout-minutes: 30 - needs: [release] - env: - DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }} + needs: [e2e-linux] steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/scripts/release-aur-bin.sh b/scripts/release-aur-bin.sh index 74eba3c4f4..421f012745 100755 --- a/scripts/release-aur-bin.sh +++ b/scripts/release-aur-bin.sh @@ -67,7 +67,11 @@ EOF cd aur-bin git add .SRCINFO PKGBUILD +if git diff-index --quiet HEAD --; then + echo "No changes to PKGBUILD or .SRCINFO" + exit 0 +fi git commit -m "rtx ${RTX_VERSION#v}" -if [[ "$DRY_RUN" != 1 ]]; then +if [[ "$DRY_RUN" == 0 ]]; then git push fi diff --git a/scripts/release-aur.sh b/scripts/release-aur.sh index 39f52e653b..49c02cd767 100755 --- a/scripts/release-aur.sh +++ b/scripts/release-aur.sh @@ -73,7 +73,11 @@ EOF cd aur git add .SRCINFO PKGBUILD +if git diff-index --quiet HEAD --; then + echo "No changes to PKGBUILD or .SRCINFO" + exit 0 +fi git commit -m "rtx ${RTX_VERSION#v}" -if [ "$DRY_RUN" != 1 ]; then +if [ "$DRY_RUN" == 0 ]; then git push fi