Skip to content

Commit dda7244

Browse files
committed
feat: restructure build process
1 parent a71f4cd commit dda7244

18 files changed

+512
-578
lines changed

.github/renovate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
],
66
"packageRules": [
77
{
8-
"datasources": [
8+
"matchDatasources": [
99
"docker"
1010
],
11-
"updateTypes": [
11+
"matchUpdateTypes": [
1212
"major",
1313
"minor",
1414
"patch"

.github/semantic.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
commitsOnly: true
3+
anyCommit: true
4+
allowMergeCommits: true
5+
allowRevertCommits: true
6+
7+
types:
8+
- feat
9+
- fix
10+
- docs
11+
- style
12+
- refactor
13+
- perf
14+
- test
15+
- build
16+
- ci
17+
- chore
18+
- revert
19+
- major
20+
- minor
21+
- patch
22+
23+
...

.github/settings.yml

Lines changed: 70 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ repository:
1111

1212
default_branch: master
1313

14+
allow_merge_commit: false
1415
allow_squash_merge: true
15-
allow_merge_commit: true
1616
allow_rebase_merge: true
1717

1818
allow_update_branch: true
@@ -21,23 +21,75 @@ repository:
2121
enable_automated_security_fixes: true
2222
enable_vulnerability_alerts: true
2323

24-
branches:
25-
- name: master
26-
protection:
27-
required_pull_request_reviews: null
28-
required_status_checks:
29-
strict: true
30-
contexts: []
31-
enforce_admins: false
32-
restrictions:
33-
apps:
34-
- dockhippie
35-
- renovate
36-
users: []
37-
teams:
38-
- admins
39-
- bots
40-
- members
24+
rulesets:
25+
- name: prevent destruction
26+
target: branch
27+
enforcement: active
28+
conditions:
29+
ref_name:
30+
include:
31+
- "~DEFAULT_BRANCH"
32+
exclude: []
33+
rules:
34+
- type: required_linear_history
35+
- type: deletion
36+
- type: non_fast_forward
37+
38+
- name: check verification
39+
target: branch
40+
enforcement: active
41+
conditions:
42+
ref_name:
43+
include:
44+
- "~DEFAULT_BRANCH"
45+
exclude: []
46+
rules:
47+
- type: required_status_checks
48+
parameters:
49+
strict_required_status_checks_policy: true
50+
required_status_checks:
51+
- context: Semantic PR
52+
integration_id: 198092
53+
bypass_actors:
54+
- actor_id: 1
55+
actor_type: OrganizationAdmin
56+
bypass_mode: always
57+
- actor_id: 951565 # app
58+
actor_type: Integration
59+
bypass_mode: always
60+
- actor_id: 6277016 # bots
61+
actor_type: Team
62+
bypass_mode: always
63+
64+
- name: require reviewing
65+
target: branch
66+
enforcement: active
67+
conditions:
68+
ref_name:
69+
include:
70+
- "~DEFAULT_BRANCH"
71+
exclude: []
72+
rules:
73+
- type: pull_request
74+
parameters:
75+
allowed_merge_methods:
76+
- squash
77+
- rebase
78+
dismiss_stale_reviews_on_push: false
79+
require_code_owner_review: false
80+
require_last_push_approval: false
81+
required_approving_review_count: 0
82+
required_review_thread_resolution: false
83+
bypass_actors:
84+
- actor_id: 1
85+
actor_type: OrganizationAdmin
86+
bypass_mode: always
87+
- actor_id: 951565 # app
88+
actor_type: Integration
89+
bypass_mode: always
90+
- actor_id: 6277016 # bots
91+
actor_type: Team
92+
bypass_mode: always
4193

4294
teams:
4395
- name: admins

.github/workflows/automerge.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
23
name: automerge
34

45
"on":
@@ -10,6 +11,7 @@ name: automerge
1011
permissions:
1112
contents: write
1213
pull-requests: write
14+
issues: write
1315

1416
jobs:
1517
dependabot:
@@ -18,7 +20,6 @@ jobs:
1820

1921
steps:
2022
- name: Generate token
21-
id: token
2223
uses: tibdex/github-app-token@v2
2324
with:
2425
app_id: ${{ secrets.TOKEN_EXCHANGE_APP }}
@@ -29,19 +30,16 @@ jobs:
2930
{"contents": "write", "pull_requests": "write", "issues": "write"}
3031
3132
- name: Fetch metadata
32-
id: metadata
3333
uses: dependabot/fetch-metadata@v2
3434
with:
3535
github-token: ${{ secrets.GITHUB_TOKEN }}
3636

3737
- name: Approve request
38-
id: approve
3938
run: gh pr review --approve "${{github.event.pull_request.html_url}}"
4039
env:
4140
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4241

4342
- name: Enable automerge
44-
id: automerge
4543
run: gh pr merge --rebase --auto "${{github.event.pull_request.html_url}}"
4644
env:
4745
GH_TOKEN: ${{ steps.token.outputs.token }}

.github/workflows/docker.yml

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
23
name: latest
34

45
"on":
6+
workflow_dispatch:
57
push:
68
branches:
79
- master
@@ -14,15 +16,26 @@ name: latest
1416
paths:
1517
- latest/*
1618
- .github/workflows/docker.yml
17-
workflow_dispatch:
19+
20+
permissions:
21+
contents: read
22+
packages: write
1823

1924
jobs:
2025
docker:
2126
runs-on: ubuntu-latest
2227

28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
variant:
32+
- arch: amd64
33+
platform: linux/amd64
34+
- arch: arm64
35+
platform: linux/arm64
36+
2337
steps:
2438
- name: Checkout source
25-
id: source
2639
uses: actions/checkout@v5
2740

2841
- name: Docker meta
@@ -39,23 +52,20 @@ jobs:
3952
maintainer=Thomas Boerger <[email protected]>
4053
4154
- name: Setup QEMU
42-
id: qemu
4355
uses: docker/setup-qemu-action@v3
4456

4557
- name: Setup Buildx
4658
id: buildx
4759
uses: docker/setup-buildx-action@v3
4860

4961
- name: Hub login
50-
id: login1
5162
uses: docker/login-action@v3
5263
if: github.event_name != 'pull_request'
5364
with:
5465
username: ${{ secrets.DOCKER_USERNAME }}
5566
password: ${{ secrets.DOCKER_PASSWORD }}
5667

5768
- name: Quay login
58-
id: login2
5969
uses: docker/login-action@v3
6070
if: github.event_name != 'pull_request'
6171
with:
@@ -64,50 +74,41 @@ jobs:
6474
password: ${{ secrets.QUAY_PASSWORD }}
6575

6676
- name: Ghcr login
67-
id: login3
6877
uses: docker/login-action@v3
6978
if: github.event_name != 'pull_request'
7079
with:
7180
registry: ghcr.io
7281
username: ${{ github.actor }}
7382
password: ${{ secrets.GITHUB_TOKEN }}
7483

75-
- name: Build amd64
76-
id: amd64
84+
- name: Build image
7785
uses: docker/build-push-action@v6
7886
with:
7987
builder: ${{ steps.buildx.outputs.name }}
8088
context: latest/
8189
provenance: false
82-
file: latest/Dockerfile.amd64
83-
platforms: linux/amd64
90+
file: latest/Dockerfile.${{ matrix.variant.arch }}
91+
platforms: ${{ matrix.variant.platform }}
8492
push: ${{ github.event_name != 'pull_request' }}
8593
labels: ${{ steps.meta.outputs.labels }}
8694
tags: |
87-
webhippie/minecraft-vanilla:latest-amd64
88-
quay.io/webhippie/minecraft-vanilla:latest-amd64
89-
ghcr.io/dockhippie/minecraft-vanilla:latest-amd64
95+
webhippie/minecraft-vanilla:latest-${{ matrix.variant.arch }}
96+
quay.io/webhippie/minecraft-vanilla:latest-${{ matrix.variant.arch }}
97+
ghcr.io/dockhippie/minecraft-vanilla:latest-${{ matrix.variant.arch }}
9098
91-
- name: Build arm64
92-
id: arm64
93-
uses: docker/build-push-action@v6
94-
with:
95-
builder: ${{ steps.buildx.outputs.name }}
96-
context: latest/
97-
provenance: false
98-
file: latest/Dockerfile.arm64
99-
platforms: linux/arm64
100-
push: ${{ github.event_name != 'pull_request' }}
101-
labels: ${{ steps.meta.outputs.labels }}
102-
tags: |
103-
webhippie/minecraft-vanilla:latest-arm64
104-
quay.io/webhippie/minecraft-vanilla:latest-arm64
105-
ghcr.io/dockhippie/minecraft-vanilla:latest-arm64
99+
manifest:
100+
runs-on: ubuntu-latest
101+
if: github.event_name != 'pull_request'
102+
103+
needs:
104+
- docker
105+
106+
steps:
107+
- name: Checkout source
108+
uses: actions/checkout@v5
106109

107110
- name: Hub manifest
108-
id: manifest1
109111
uses: actionhippie/manifest@v1
110-
if: github.event_name != 'pull_request'
111112
with:
112113
username: ${{ secrets.DOCKER_USERNAME }}
113114
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -117,9 +118,7 @@ jobs:
117118
ignore_missing: true
118119

119120
- name: Quay manifest
120-
id: manifest2
121121
uses: actionhippie/manifest@v1
122-
if: github.event_name != 'pull_request'
123122
with:
124123
username: ${{ secrets.QUAY_USERNAME }}
125124
password: ${{ secrets.QUAY_PASSWORD }}
@@ -129,9 +128,7 @@ jobs:
129128
ignore_missing: true
130129

131130
- name: Ghcr manifest
132-
id: manifest3
133131
uses: actionhippie/manifest@v1
134-
if: github.event_name != 'pull_request'
135132
with:
136133
username: ${{ github.actor }}
137134
password: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/readme.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
2+
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
23
name: readme
34

45
"on":
6+
workflow_dispatch:
57
push:
68
branches:
79
- master
8-
paths:
9-
- README.md
10-
workflow_dispatch:
1110

1211
jobs:
1312
readme:
@@ -17,18 +16,17 @@ jobs:
1716
- name: Checkout source
1817
uses: actions/checkout@v5
1918

20-
- name: Push readme
19+
- name: Hub readme
2120
uses: actionhippie/pushrm@v1
22-
if: github.event_name != 'pull_request'
2321
with:
2422
provider: dockerhub
2523
target: webhippie/minecraft-vanilla
2624
username: ${{ secrets.DOCKER_USERNAME }}
2725
password: ${{ secrets.DOCKER_PASSWORD }}
28-
description: Docker image for minecraft-vanilla
26+
description: Docker image for Vanilla Minecraft
2927
readme: README.md
3028

31-
- name: Push readme
29+
- name: Quay readme
3230
uses: actionhippie/pushrm@v1
3331
with:
3432
provider: quay

0 commit comments

Comments
 (0)