From bfa1723aedbf4d528c08f197c6e2a7e6ecbd310f Mon Sep 17 00:00:00 2001 From: ajnart Date: Sun, 6 Sep 2026 09:39:25 +0200 Subject: [PATCH] fix(ci): restore release automation --- .../workflows/bot-auto-merge-reconcile.yml | 2 +- .github/workflows/bot-pr-automerge.yml | 2 +- .../workflows/crowdin-schedule-download.yml | 2 +- .github/workflows/deployment-beta-release.yml | 4 +- .github/workflows/deployment-docker-image.yml | 4 +- .../workflows/deployment-weekly-release.yml | 42 ++++++++++++++----- .github/workflows/on-release.yml | 4 +- .github/workflows/update-contributors.yml | 2 +- .github/workflows/update-integration-list.yml | 2 +- 9 files changed, 42 insertions(+), 22 deletions(-) diff --git a/.github/workflows/bot-auto-merge-reconcile.yml b/.github/workflows/bot-auto-merge-reconcile.yml index d82f759f5..26ddf53a1 100644 --- a/.github/workflows/bot-auto-merge-reconcile.yml +++ b/.github/workflows/bot-auto-merge-reconcile.yml @@ -20,7 +20,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} + app-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} permission-pull-requests: write # required to enable auto-merge - name: Install GitHub CLI diff --git a/.github/workflows/bot-pr-automerge.yml b/.github/workflows/bot-pr-automerge.yml index 35c5461fa..f1e531bc2 100644 --- a/.github/workflows/bot-pr-automerge.yml +++ b/.github/workflows/bot-pr-automerge.yml @@ -28,7 +28,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} + app-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} permission-pull-requests: write # required to approve a pull request and enable auto-merge - name: Install GitHub CLI diff --git a/.github/workflows/crowdin-schedule-download.yml b/.github/workflows/crowdin-schedule-download.yml index 22cb2b943..7b783f4e5 100644 --- a/.github/workflows/crowdin-schedule-download.yml +++ b/.github/workflows/crowdin-schedule-download.yml @@ -22,7 +22,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.CROWDIN_APP_PRIVATE_KEY }} - client-id: ${{ secrets.CROWDIN_APP_ID }} + app-id: ${{ secrets.CROWDIN_APP_ID }} permission-contents: write # required to commit to crowdin branch permission-pull-requests: write # required to create pull request diff --git a/.github/workflows/deployment-beta-release.yml b/.github/workflows/deployment-beta-release.yml index ba3bde3a2..0f0725bef 100644 --- a/.github/workflows/deployment-beta-release.yml +++ b/.github/workflows/deployment-beta-release.yml @@ -52,7 +52,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} + app-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} permission-pull-requests: write - name: Approve PR env: @@ -64,7 +64,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} + app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} permission-contents: write # write to beta branch (due to merge) permission-pull-requests: write # merge pull request - id: automerge diff --git a/.github/workflows/deployment-docker-image.yml b/.github/workflows/deployment-docker-image.yml index 14135e7f8..cc0a6498f 100644 --- a/.github/workflows/deployment-docker-image.yml +++ b/.github/workflows/deployment-docker-image.yml @@ -54,7 +54,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} + app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} permission-contents: write # required to commit package.json & changelog changes, merge them to dev / next and publish the release - uses: actions/checkout@v7 @@ -274,7 +274,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} + app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} permission-contents: write # required to publish the release - name: Log in to the Container registry diff --git a/.github/workflows/deployment-weekly-release.yml b/.github/workflows/deployment-weekly-release.yml index cafa7b30d..b08b0c08c 100644 --- a/.github/workflows/deployment-weekly-release.yml +++ b/.github/workflows/deployment-weekly-release.yml @@ -19,10 +19,10 @@ permissions: jobs: create-and-merge-pr: runs-on: ubuntu-latest - timeout-minutes: 2 + timeout-minutes: 10 steps: - name: Discord notification - if: ${{ github.event.inputs.send-notifications }} + if: ${{ github.event_name == 'schedule' || inputs.send-notifications }} env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@0.4.0 @@ -38,13 +38,30 @@ jobs: with: token: ${{ github.token }} branch: dev + noNewCommitBehavior: silent + noVersionBumpBehavior: silent + - name: No release needed + if: ${{ steps.semver.outputs.bump == '' || steps.semver.outputs.bump == 'none' }} + run: echo "No release-worthy commits were found since ${{ steps.semver.outputs.current }}." >> "$GITHUB_STEP_SUMMARY" - name: Create pull request id: create-pull-request - run: 'gh pr create --title "chore(release): automatic release ${{ steps.semver.outputs.next }}" --body "**This is an automatic release**.
Manual action may be required for major bumps.
Detected change to be ``${{ steps.semver.outputs.bump }}``
Bump version from ``${{ steps.semver.outputs.current }}`` to ``${{ steps.semver.outputs.next }}``" --base main --head dev --label automerge' + if: ${{ steps.semver.outputs.bump != '' && steps.semver.outputs.bump != 'none' }} + run: | + pr_url="$(gh pr list --base main --head dev --state open --json url --jq '.[0].url // empty')" + if [[ -z "$pr_url" ]]; then + pr_url="$(gh pr create \ + --title "chore(release): automatic release ${{ steps.semver.outputs.next }}" \ + --body "**This is an automatic release**.
Manual action may be required for major bumps.
Detected change to be ``${{ steps.semver.outputs.bump }}``
Bump version from ``${{ steps.semver.outputs.current }}`` to ``${{ steps.semver.outputs.next }}``" \ + --base main \ + --head dev \ + --label automerge)" + fi + echo "url=$pr_url" >> "$GITHUB_OUTPUT" + echo "pr_number=${pr_url##*/}" >> "$GITHUB_OUTPUT" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Discord notification - if: ${{ github.event.inputs.send-notifications }} + if: ${{ steps.create-pull-request.outcome == 'success' && (github.event_name == 'schedule' || inputs.send-notifications) }} env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@0.4.0 @@ -52,26 +69,29 @@ jobs: args: "Created a release PR ${{ steps.create-pull-request.outputs.url }} for version ${{ steps.semver.outputs.next }} (new behaviour: ${{ steps.semver.outputs.bump }})" - name: Obtain token id: obtainApprovalToken + if: ${{ steps.create-pull-request.outcome == 'success' }} uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} + app-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} permission-pull-requests: write - name: Approve PR + if: ${{ steps.create-pull-request.outcome == 'success' }} env: GITHUB_TOKEN: ${{ steps.obtainApprovalToken.outputs.token }} run: | - gh pr review --approve --body "Automatically approved by GitHub Action" + gh pr review "${{ steps.create-pull-request.outputs.url }}" --approve --body "Automatically approved by GitHub Action" - name: Obtain token id: obtainMergeToken + if: ${{ steps.create-pull-request.outcome == 'success' }} uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} + app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} permission-contents: write # write to main branch (due to merge) permission-pull-requests: write # merge pull request - id: automerge - if: ${{ steps.semver.outputs.bump != 'major' }} + if: ${{ steps.create-pull-request.outcome == 'success' && steps.semver.outputs.bump != 'major' }} name: automerge uses: "pascalgn/automerge-action@v0.16.4" env: @@ -85,21 +105,21 @@ jobs: MERGE_REQUIRED_APPROVALS: 0 # do not require approvals - name: Merged Discord notification - if: ${{ steps.automerge.outputs.mergeResult == 'merged' && github.event.inputs.send-notifications }} + if: ${{ steps.automerge.outputs.mergeResult == 'merged' && (github.event_name == 'schedule' || inputs.send-notifications) }} env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@0.4.0 with: args: "Merged PR ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}" - name: Major Bump Discord notification - if: ${{ steps.semver.outputs.bump == 'major' && github.event.inputs.send-notifications }} + if: ${{ steps.semver.outputs.bump == 'major' && (github.event_name == 'schedule' || inputs.send-notifications) }} env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@0.4.0 with: args: "The release PR must be manually merged because the next version is a major version: ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}" - name: Discord Fail Notification - if: failure() && github.event.inputs.send-notifications + if: ${{ failure() && (github.event_name == 'schedule' || inputs.send-notifications) }} env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@0.4.0 diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 644f4a74d..dd04e2e1b 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -15,7 +15,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.HOMARR_DOCS_RELEASE_APP_PRIVATE_KEY }} - client-id: ${{ vars.HOMARR_DOCS_RELEASE_APP_ID }} + app-id: ${{ vars.HOMARR_DOCS_RELEASE_APP_ID }} owner: homarr-labs repositories: | documentation @@ -48,7 +48,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }} - client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} + app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }} permission-contents: write # required to commit to branch permission-pull-requests: write # required to create pr & enable automerge - name: Checkout code diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index c185e0527..1966a8a23 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -21,7 +21,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.HOMARR_UPDATE_CONTRIBUTORS_PRIVATE_KEY }} - client-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }} + app-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }} permission-contents: write # required to commit to branch permission-pull-requests: write # required to create pr & enable automerge diff --git a/.github/workflows/update-integration-list.yml b/.github/workflows/update-integration-list.yml index d6fdcab73..eb37f2643 100644 --- a/.github/workflows/update-integration-list.yml +++ b/.github/workflows/update-integration-list.yml @@ -24,7 +24,7 @@ jobs: uses: actions/create-github-app-token@v3 with: private-key: ${{ secrets.HOMARR_UPDATE_CONTRIBUTORS_PRIVATE_KEY }} - client-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }} + app-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }} permission-contents: write # required to commit to branch permission-pull-requests: write # required to create pr & enable automerge - name: Checkout code