Skip to content

Commit ce9a53a

Browse files
committed
update workflows
1 parent 07e7e75 commit ce9a53a

14 files changed

+651
-159
lines changed

.github/workflows/copyright.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,25 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
update:
9+
update-copyright:
1010
runs-on: ubuntu-latest
1111
steps:
1212

1313
- name: Get current year
1414
id: date
1515
run: echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT
1616

17+
- name: Create App Token
18+
uses: actions/create-github-app-token@v1
19+
id: app-token
20+
with:
21+
app-id: ${{ vars.APP_ID }}
22+
private-key: ${{ secrets.APP_TOKEN }}
23+
1724
- name: Check Out Repo
1825
uses: actions/checkout@v4
1926
with:
27+
token: ${{ steps.app-token.outputs.token }}
2028
ref: develop
2129

2230
- name: Update Copyright
@@ -41,11 +49,11 @@ jobs:
4149
if: failure()
4250
with:
4351
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
44-
message: <@&1079153184007790652>
45-
title: "${{ secrets.REPO_NAME }}: **Copyright Update Failed**"
46-
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
47-
color: 14879811
48-
username: Kobota
49-
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
50-
author: GitHub
51-
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/git.png
52+
message: ${{ vars.BUILD_FAILURE_ROLE }}
53+
title: "${{ vars.REPO_NAME }}: ${{ vars.TEXT_COPYRIGHT }}"
54+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
55+
color: ${{ vars.COLOR_FAILURE }}
56+
username: ${{ vars.BOT_NAME }}
57+
avatar_url: ${{ vars.BOT_IMAGE }}
58+
author: ${{ vars.GIT_NAME }}
59+
author_icon_url: ${{ vars.GIT_IMAGE }}

.github/workflows/develop.yml

-84
This file was deleted.

.github/workflows/docker-develop.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Docker Develop Build
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
7+
jobs:
8+
9+
docker-build-develop:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Check Out Repo
14+
uses: actions/checkout@v4
15+
with:
16+
ref: develop
17+
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
22+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@master
26+
with:
27+
platforms: all
28+
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Build and push
34+
id: docker_build
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: ./
38+
file: ./Dockerfile
39+
build-args: |
40+
"BRANCH_NAME=develop"
41+
platforms: linux/amd64,linux/arm64,linux/arm/v7
42+
push: true
43+
tags: ${{ vars.DOCKER_TEAM }}/${{ vars.DOCKER_REPO }}:develop
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max
46+
47+
- name: Discord Success Notification
48+
uses: Kometa-Team/discord-notifications@master
49+
if: success()
50+
with:
51+
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
52+
title: "${{ vars.NAME }} develop: ${{ vars.TEXT_SUCCESS }}"
53+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
54+
color: ${{ vars.COLOR_SUCCESS }}
55+
username: ${{ vars.BOT_NAME }}
56+
avatar_url: ${{ vars.BOT_IMAGE }}
57+
author: ${{ vars.DOCKER_NAME }}
58+
author_icon_url: ${{ vars.DOCKER_IMAGE }}
59+
60+
- name: Discord Failure Notification
61+
uses: Kometa-Team/discord-notifications@master
62+
if: failure()
63+
with:
64+
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
65+
message: ${{ vars.BUILD_FAILURE_ROLE }}
66+
title: "${{ vars.NAME }} develop: ${{ vars.TEXT_FAILURE }}"
67+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
68+
color: ${{ vars.COLOR_FAILURE }}
69+
username: ${{ vars.BOT_NAME }}
70+
avatar_url: ${{ vars.BOT_IMAGE }}
71+
author: ${{ vars.DOCKER_NAME }}
72+
author_icon_url: ${{ vars.DOCKER_IMAGE }}
73+
74+
commit-notification:
75+
runs-on: ubuntu-latest
76+
needs: [ docker-build-develop ]
77+
if: ${{ success() }}
78+
steps:
79+
80+
- name: Send Discord Commit Notification
81+
uses: Kometa-Team/discord-notifications@master
82+
with:
83+
webhook_id_token: ${{ secrets.DEVELOP_WEBHOOK }}
84+
title: Commits
85+
message: "${{ vars.DEVELOP_ROLE }} - An update to ${{ vars.NAME }} has been published and is available to users of the **develop** branch."
86+
commits: "true"
87+
color: ${{ vars.COLOR_SUCCESS }}
88+
username: ${{ vars.BOT_NAME }}
89+
avatar_url: ${{ vars.BOT_IMAGE }}
90+
author: ${{ vars.NAME }} Develop Release
91+
author_icon_url: ${{ vars.RELEASE_IMAGE }}

.github/workflows/latest.yml renamed to .github/workflows/docker-latest.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Docker Latest Release
1+
name: Docker Latest Build
22

33
on:
44
push:
55
branches: [ master ]
66

77
jobs:
88

9-
docker:
9+
docker-build-latest:
1010
runs-on: ubuntu-latest
1111
steps:
1212

@@ -34,33 +34,33 @@ jobs:
3434
with:
3535
context: ./
3636
file: ./Dockerfile
37-
platforms: linux/amd64,linux/arm64
37+
platforms: linux/amd64,linux/arm64,linux/arm/v7
3838
push: true
39-
tags: kometateam/${{ secrets.DOCKER_REPO }}:latest
39+
tags: ${{ vars.DOCKER_TEAM }}/${{ vars.DOCKER_REPO }}:latest
4040

4141
- name: Discord Success Notification
4242
uses: Kometa-Team/discord-notifications@master
4343
if: success()
4444
with:
4545
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
46-
title: "${{ secrets.REPO_NAME }} latest: **Build Successful**"
47-
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
48-
color: 844716
49-
username: Kobota
50-
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
51-
author: Docker
52-
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
46+
title: "${{ vars.NAME }} latest: ${{ vars.TEXT_SUCCESS }}"
47+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
48+
color: ${{ vars.COLOR_SUCCESS }}
49+
username: ${{ vars.BOT_NAME }}
50+
avatar_url: ${{ vars.BOT_IMAGE }}
51+
author: ${{ vars.DOCKER_NAME }}
52+
author_icon_url: ${{ vars.DOCKER_IMAGE }}
5353

5454
- name: Discord Failure Notification
5555
uses: Kometa-Team/discord-notifications@master
5656
if: failure()
5757
with:
5858
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
59-
message: <@&1079153184007790652>
60-
title: "${{ secrets.REPO_NAME }} latest: **Build Failed**"
61-
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
62-
color: 14879811
63-
username: Kobota
64-
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
65-
author: Docker
66-
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
59+
message: ${{ vars.BUILD_FAILURE_ROLE }}
60+
title: "${{ vars.NAME }} latest: ${{ vars.TEXT_FAILURE }}"
61+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
62+
color: ${{ vars.COLOR_FAILURE }}
63+
username: ${{ vars.BOT_NAME }}
64+
avatar_url: ${{ vars.BOT_IMAGE }}
65+
author: ${{ vars.DOCKER_NAME }}
66+
author_icon_url: ${{ vars.DOCKER_IMAGE }}

.github/workflows/version.yml renamed to .github/workflows/docker-version.yml

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Version Release
1+
name: Docker Version Build
22

33
on:
44
create:
@@ -7,9 +7,9 @@ on:
77

88
jobs:
99

10-
docker:
10+
docker-build-version:
11+
if: ${{ startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') }}
1112
runs-on: ubuntu-latest
12-
1313
steps:
1414

1515
- name: Check Out Repo
@@ -42,40 +42,42 @@ jobs:
4242
with:
4343
context: ./
4444
file: ./Dockerfile
45-
platforms: linux/amd64,linux/arm64
45+
platforms: linux/amd64,linux/arm64,linux/arm/v7
4646
push: true
47-
tags: kometateam/${{ secrets.DOCKER_REPO }}:${{ steps.get_version.outputs.VERSION }}
47+
tags: ${{ vars.DOCKER_TEAM }}/${{ vars.DOCKER_REPO }}:${{ steps.get_version.outputs.VERSION }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
4850

4951
- name: Discord Success Notification
5052
uses: Kometa-Team/discord-notifications@master
5153
if: success()
5254
with:
5355
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
54-
title: "${{ secrets.REPO_NAME }} ${{ steps.get_version.outputs.VERSION }}: **Build Successful**"
55-
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
56-
color: 844716
57-
username: Kobota
58-
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
59-
author: Docker
60-
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
56+
title: "${{ vars.NAME }} ${{ steps.get_version.outputs.VERSION }}: ${{ vars.TEXT_SUCCESS }}"
57+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
58+
color: ${{ vars.COLOR_SUCCESS }}
59+
username: ${{ vars.BOT_NAME }}
60+
avatar_url: ${{ vars.BOT_IMAGE }}
61+
author: ${{ vars.DOCKER_NAME }}
62+
author_icon_url: ${{ vars.DOCKER_IMAGE }}
6163

6264
- name: Discord Failure Notification
6365
uses: Kometa-Team/discord-notifications@master
6466
if: failure()
6567
with:
6668
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
67-
message: <@&1079153184007790652>
68-
title: "${{ secrets.REPO_NAME }} ${{ steps.get_version.outputs.VERSION }}: **Build Failed**"
69-
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
70-
color: 14879811
71-
username: Kobota
72-
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
73-
author: Docker
74-
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/docker.png
69+
message: ${{ vars.BUILD_FAILURE_ROLE }}
70+
title: "${{ vars.NAME }} ${{ steps.get_version.outputs.VERSION }}: ${{ vars.TEXT_FAILURE }}"
71+
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
72+
color: ${{ vars.COLOR_FAILURE }}
73+
username: ${{ vars.BOT_NAME }}
74+
avatar_url: ${{ vars.BOT_IMAGE }}
75+
author: ${{ vars.DOCKER_NAME }}
76+
author_icon_url: ${{ vars.DOCKER_IMAGE }}
7577

7678
- name: Create release
7779
uses: marvinpinto/action-automatic-releases@latest
7880
with:
79-
title: ${{ secrets.NAME }} ${{ github.event.ref }}
81+
title: ${{ vars.NAME }} ${{ github.event.ref }}
8082
repo_token: ${{ secrets.PAT }}
8183
prerelease: false

0 commit comments

Comments
 (0)