[36] update GitHub actions (#2090)

This commit is contained in:
meisnate12 2024-05-31 09:59:14 -04:00 committed by GitHub Action
parent 2c980e99b1
commit 9a768a77bf
12 changed files with 88 additions and 26 deletions

View file

@ -14,9 +14,17 @@ jobs:
id: date id: date
run: echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT 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 - name: Check Out Repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
token: ${{ steps.app-token.outputs.token }}
ref: nightly ref: nightly
- name: Update Copyright - name: Update Copyright

View file

@ -1,4 +1,4 @@
name: Docker Develop Release name: Docker Develop Build
on: on:
push: push:
@ -6,7 +6,7 @@ on:
jobs: jobs:
docker-build: docker-build-develop:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -73,7 +73,7 @@ jobs:
commit-notification: commit-notification:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ docker-build ] needs: [ docker-build-develop ]
if: ${{ success() }} if: ${{ success() }}
steps: steps:

View file

@ -1,4 +1,4 @@
name: Docker Latest Release name: Docker Latest Build
on: on:
push: push:
@ -6,7 +6,7 @@ on:
jobs: jobs:
docker-build: docker-build-latest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -1,14 +1,14 @@
name: Docker Nightly Release name: Docker Nightly Build
on: on:
workflow_run: workflow_run:
workflows: ["Release New Version"] workflows: ["Master Release"]
types: types:
- completed - completed
jobs: jobs:
docker-build: docker-build-nightly:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -1,4 +1,4 @@
name: Docker Version Release name: Docker Version Build
on: on:
create: create:
@ -7,7 +7,7 @@ on:
jobs: jobs:
docker-build: docker-build-version:
if: ${{ startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') }} if: ${{ startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -1,4 +1,4 @@
name: Update Build Version name: Increment Build
on: on:
pull_request: pull_request:
@ -6,7 +6,7 @@ on:
types: [closed] types: [closed]
jobs: jobs:
increment-version: increment-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.base_ref == 'nightly' && github.event.pull_request.merged if: github.base_ref == 'nightly' && github.event.pull_request.merged
outputs: outputs:
@ -62,7 +62,7 @@ jobs:
verify-changes: verify-changes:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ increment-version ] needs: [ increment-build ]
outputs: outputs:
build: ${{ steps.list-changes.outputs.build }} build: ${{ steps.list-changes.outputs.build }}
steps: steps:
@ -89,9 +89,9 @@ jobs:
fi fi
done done
docker-build: docker-build-nightly:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ increment-version, verify-changes ] needs: [ increment-build, verify-changes ]
if: needs.verify-changes.outputs.build == 'true' if: needs.verify-changes.outputs.build == 'true'
steps: steps:
@ -158,7 +158,7 @@ jobs:
commit-notification: commit-notification:
runs-on: ubuntu-latest 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' }} if: ${{ success() && needs.verify-changes.outputs.build == 'true' }}
steps: steps:
@ -166,9 +166,9 @@ jobs:
uses: Kometa-Team/discord-notifications@master uses: Kometa-Team/discord-notifications@master
with: with:
webhook_id_token: ${{ secrets.NIGHTLY_WEBHOOK }} webhook_id_token: ${{ secrets.NIGHTLY_WEBHOOK }}
title: Kometa ${{ needs.increment-version.outputs.version }} Build ${{ needs.increment-version.outputs.build-value }} title: Kometa ${{ needs.increment-build.outputs.version }} Build ${{ needs.increment-build.outputs.build-value }}
url: https://github.com/Kometa-Team/Kometa/commit/${{ needs.increment-version.outputs.commit-hash }} url: https://github.com/Kometa-Team/Kometa/commit/${{ needs.increment-build.outputs.commit-hash }}
description: ${{ needs.increment-version.outputs.commit-msg }} 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." message: "<@&967002147520675840> - An update to Kometa has now been published and is available to users of the **nightly** branch."
color: ${{ vars.COLOR_SUCCESS }} color: ${{ vars.COLOR_SUCCESS }}
username: ${{ vars.BOT_NAME }} username: ${{ vars.BOT_NAME }}

View file

@ -1,10 +1,10 @@
name: Merge Nightly into Develop name: Develop Release
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
merge-develop: release-develop:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -80,3 +80,30 @@ jobs:
exit 1 exit 1
fi fi
done 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 }}

View file

@ -1,10 +1,10 @@
name: Release New Version name: Master Release
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
merge-master: release-master:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -44,3 +44,30 @@ jobs:
git push origin nightly git push origin nightly
git push origin refs/heads/nightly:refs/heads/develop git push origin refs/heads/nightly:refs/heads/develop
git push origin refs/heads/nightly:refs/heads/main 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 }}

View file

@ -1,4 +1,4 @@
name: Release name: Release Notification
on: on:
release: release:

View file

@ -29,7 +29,7 @@ jobs:
- name: Run Spellcheck - name: Run Spellcheck
uses: rojopolis/spellcheck-github-actions@0.36.0 uses: rojopolis/spellcheck-github-actions@0.36.0
docker-build: docker-build-pull:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ validate-pull ] needs: [ validate-pull ]
if: contains(github.event.pull_request.labels.*.name, 'docker') if: contains(github.event.pull_request.labels.*.name, 'docker')

View file

@ -1 +1 @@
2.0.1-build35 2.0.1-build36