From 9a768a77bff0952b9d0447e867087fc5f10694b1 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 31 May 2024 09:59:14 -0400 Subject: [PATCH] [36] update GitHub actions (#2090) --- .github/workflows/copyright.yml | 8 +++++ .github/workflows/docker-develop.yml | 6 ++-- .github/workflows/docker-latest.yml | 4 +-- .github/workflows/docker-nightly.yml | 6 ++-- .github/workflows/docker-version.yml | 4 +-- .../{version.yml => increment-build.yml} | 18 +++++------ ...{merge-develop.yml => release-develop.yml} | 31 +++++++++++++++++-- .../{merge-master.yml => release-master.yml} | 31 +++++++++++++++++-- .../{release.yml => release-notification.yml} | 2 +- .../{tag.yml => tag-new-version.yml} | 0 .../{validate.yml => validate-pull.yml} | 2 +- VERSION | 2 +- 12 files changed, 88 insertions(+), 26 deletions(-) rename .github/workflows/{version.yml => increment-build.yml} (92%) rename .github/workflows/{merge-develop.yml => release-develop.yml} (65%) rename .github/workflows/{merge-master.yml => release-master.yml} (51%) rename .github/workflows/{release.yml => release-notification.yml} (91%) rename .github/workflows/{tag.yml => tag-new-version.yml} (100%) rename .github/workflows/{validate.yml => validate-pull.yml} (97%) diff --git a/.github/workflows/copyright.yml b/.github/workflows/copyright.yml index dfcd84db..fe675ab6 100644 --- a/.github/workflows/copyright.yml +++ b/.github/workflows/copyright.yml @@ -14,9 +14,17 @@ jobs: id: date run: echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT + - name: Create App Token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.APP_TOKEN }} + - name: Check Out Repo uses: actions/checkout@v4 with: + token: ${{ steps.app-token.outputs.token }} ref: nightly - name: Update Copyright diff --git a/.github/workflows/docker-develop.yml b/.github/workflows/docker-develop.yml index 847d296e..f5dda714 100644 --- a/.github/workflows/docker-develop.yml +++ b/.github/workflows/docker-develop.yml @@ -1,4 +1,4 @@ -name: Docker Develop Release +name: Docker Develop Build on: push: @@ -6,7 +6,7 @@ on: jobs: - docker-build: + docker-build-develop: runs-on: ubuntu-latest steps: @@ -73,7 +73,7 @@ jobs: commit-notification: runs-on: ubuntu-latest - needs: [ docker-build ] + needs: [ docker-build-develop ] if: ${{ success() }} steps: diff --git a/.github/workflows/docker-latest.yml b/.github/workflows/docker-latest.yml index 52f7ad5c..b0682a47 100644 --- a/.github/workflows/docker-latest.yml +++ b/.github/workflows/docker-latest.yml @@ -1,4 +1,4 @@ -name: Docker Latest Release +name: Docker Latest Build on: push: @@ -6,7 +6,7 @@ on: jobs: - docker-build: + docker-build-latest: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docker-nightly.yml b/.github/workflows/docker-nightly.yml index 334764ca..0e82c826 100644 --- a/.github/workflows/docker-nightly.yml +++ b/.github/workflows/docker-nightly.yml @@ -1,14 +1,14 @@ -name: Docker Nightly Release +name: Docker Nightly Build on: workflow_run: - workflows: ["Release New Version"] + workflows: ["Master Release"] types: - completed jobs: - docker-build: + docker-build-nightly: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docker-version.yml b/.github/workflows/docker-version.yml index 83ae75f2..c9b24cbb 100644 --- a/.github/workflows/docker-version.yml +++ b/.github/workflows/docker-version.yml @@ -1,4 +1,4 @@ -name: Docker Version Release +name: Docker Version Build on: create: @@ -7,7 +7,7 @@ on: jobs: - docker-build: + docker-build-version: if: ${{ startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/version.yml b/.github/workflows/increment-build.yml similarity index 92% rename from .github/workflows/version.yml rename to .github/workflows/increment-build.yml index ff1c72ba..70e6211e 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/increment-build.yml @@ -1,4 +1,4 @@ -name: Update Build Version +name: Increment Build on: pull_request: @@ -6,7 +6,7 @@ on: types: [closed] jobs: - increment-version: + increment-build: runs-on: ubuntu-latest if: github.base_ref == 'nightly' && github.event.pull_request.merged outputs: @@ -62,7 +62,7 @@ jobs: verify-changes: runs-on: ubuntu-latest - needs: [ increment-version ] + needs: [ increment-build ] outputs: build: ${{ steps.list-changes.outputs.build }} steps: @@ -89,9 +89,9 @@ jobs: fi done - docker-build: + docker-build-nightly: runs-on: ubuntu-latest - needs: [ increment-version, verify-changes ] + needs: [ increment-build, verify-changes ] if: needs.verify-changes.outputs.build == 'true' steps: @@ -158,7 +158,7 @@ jobs: commit-notification: runs-on: ubuntu-latest - needs: [ increment-version, verify-changes, docker-build ] + needs: [ increment-build, verify-changes, docker-build-nightly ] if: ${{ success() && needs.verify-changes.outputs.build == 'true' }} steps: @@ -166,9 +166,9 @@ jobs: uses: Kometa-Team/discord-notifications@master with: webhook_id_token: ${{ secrets.NIGHTLY_WEBHOOK }} - title: Kometa ${{ needs.increment-version.outputs.version }} Build ${{ needs.increment-version.outputs.build-value }} - url: https://github.com/Kometa-Team/Kometa/commit/${{ needs.increment-version.outputs.commit-hash }} - description: ${{ needs.increment-version.outputs.commit-msg }} + title: Kometa ${{ needs.increment-build.outputs.version }} Build ${{ needs.increment-build.outputs.build-value }} + url: https://github.com/Kometa-Team/Kometa/commit/${{ needs.increment-build.outputs.commit-hash }} + description: ${{ needs.increment-build.outputs.commit-msg }} message: "<@&967002147520675840> - An update to Kometa has now been published and is available to users of the **nightly** branch." color: ${{ vars.COLOR_SUCCESS }} username: ${{ vars.BOT_NAME }} diff --git a/.github/workflows/merge-develop.yml b/.github/workflows/release-develop.yml similarity index 65% rename from .github/workflows/merge-develop.yml rename to .github/workflows/release-develop.yml index 8f655bb6..ef8911da 100644 --- a/.github/workflows/merge-develop.yml +++ b/.github/workflows/release-develop.yml @@ -1,10 +1,10 @@ -name: Merge Nightly into Develop +name: Develop Release on: workflow_dispatch: jobs: - merge-develop: + release-develop: runs-on: ubuntu-latest steps: @@ -80,3 +80,30 @@ jobs: exit 1 fi done + + - name: Discord Success Notification + uses: Kometa-Team/discord-notifications@master + if: success() + with: + webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} + title: "${{ vars.REPO_NAME }} develop pushed to Build ${{ vars.DEVELOP_BUILD }}: ${{ vars.TEXT_SUCCESS }}" + url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} + color: ${{ vars.COLOR_SUCCESS }} + username: ${{ vars.BOT_NAME }} + avatar_url: ${{ vars.BOT_IMAGE }} + author: ${{ vars.GIT_NAME }} + author_icon_url: ${{ vars.GIT_IMAGE }} + + - name: Discord Failure Notification + uses: Kometa-Team/discord-notifications@master + if: failure() + with: + webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} + message: ${{ vars.BUILD_FAILURE_ROLE }} + title: "${{ vars.REPO_NAME }} develop pushed to Build ${{ vars.DEVELOP_BUILD }}: ${{ vars.TEXT_FAILURE }}" + url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} + color: ${{ vars.COLOR_FAILURE }} + username: ${{ vars.BOT_NAME }} + avatar_url: ${{ vars.BOT_IMAGE }} + author: ${{ vars.GIT_NAME }} + author_icon_url: ${{ vars.GIT_IMAGE }} \ No newline at end of file diff --git a/.github/workflows/merge-master.yml b/.github/workflows/release-master.yml similarity index 51% rename from .github/workflows/merge-master.yml rename to .github/workflows/release-master.yml index 4adf1e78..12c1e63f 100644 --- a/.github/workflows/merge-master.yml +++ b/.github/workflows/release-master.yml @@ -1,10 +1,10 @@ -name: Release New Version +name: Master Release on: workflow_dispatch: jobs: - merge-master: + release-master: runs-on: ubuntu-latest steps: @@ -44,3 +44,30 @@ jobs: git push origin nightly git push origin refs/heads/nightly:refs/heads/develop git push origin refs/heads/nightly:refs/heads/main + + - name: Discord Success Notification + uses: Kometa-Team/discord-notifications@master + if: success() + with: + webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} + title: "${{ vars.REPO_NAME }} master release ${{ vars.NEXT_VERSION }}: ${{ vars.TEXT_SUCCESS }}" + url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} + color: ${{ vars.COLOR_SUCCESS }} + username: ${{ vars.BOT_NAME }} + avatar_url: ${{ vars.BOT_IMAGE }} + author: ${{ vars.GIT_NAME }} + author_icon_url: ${{ vars.GIT_IMAGE }} + + - name: Discord Failure Notification + uses: Kometa-Team/discord-notifications@master + if: failure() + with: + webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} + message: ${{ vars.BUILD_FAILURE_ROLE }} + title: "${{ vars.REPO_NAME }} master release ${{ vars.NEXT_VERSION }}: ${{ vars.TEXT_FAILURE }}" + url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} + color: ${{ vars.COLOR_FAILURE }} + username: ${{ vars.BOT_NAME }} + avatar_url: ${{ vars.BOT_IMAGE }} + author: ${{ vars.GIT_NAME }} + author_icon_url: ${{ vars.GIT_IMAGE }} diff --git a/.github/workflows/release.yml b/.github/workflows/release-notification.yml similarity index 91% rename from .github/workflows/release.yml rename to .github/workflows/release-notification.yml index 7c26cc14..a3b733d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-notification.yml @@ -1,4 +1,4 @@ -name: Release +name: Release Notification on: release: diff --git a/.github/workflows/tag.yml b/.github/workflows/tag-new-version.yml similarity index 100% rename from .github/workflows/tag.yml rename to .github/workflows/tag-new-version.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate-pull.yml similarity index 97% rename from .github/workflows/validate.yml rename to .github/workflows/validate-pull.yml index d6deb062..45cca9f2 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate-pull.yml @@ -29,7 +29,7 @@ jobs: - name: Run Spellcheck uses: rojopolis/spellcheck-github-actions@0.36.0 - docker-build: + docker-build-pull: runs-on: ubuntu-latest needs: [ validate-pull ] if: contains(github.event.pull_request.labels.*.name, 'docker') diff --git a/VERSION b/VERSION index 5bd79a5d..e4a5d4c2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.1-build35 +2.0.1-build36