Skip to content

Commit fc4a35f

Browse files
committed
feat: restructure build process
1 parent 4b5a423 commit fc4a35f

File tree

10 files changed

+264
-278
lines changed

10 files changed

+264
-278
lines changed

.github/renovate.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"packageRules": [
77
{
88
"description": "Update tags without merge",
9-
"datasources": [
9+
"matchDatasources": [
1010
"github-tags"
1111
],
12-
"updateTypes": [
12+
"matchUpdateTypes": [
1313
"major",
1414
"minor"
1515
],
@@ -21,10 +21,10 @@
2121
},
2222
{
2323
"description": "Update tags without merge",
24-
"datasources": [
24+
"matchDatasources": [
2525
"github-tags"
2626
],
27-
"updateTypes": [
27+
"matchUpdateTypes": [
2828
"patch"
2929
],
3030
"enabled": true,

.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: 32 additions & 49 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,28 @@ 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+
- arch: arm
37+
platform: linux/arm/v6
38+
2339
steps:
2440
- name: Checkout source
25-
id: source
2641
uses: actions/checkout@v5
2742

2843
- name: Docker meta
@@ -39,23 +54,20 @@ jobs:
3954
maintainer=Thomas Boerger <thomas@webhippie.de>
4055
4156
- name: Setup QEMU
42-
id: qemu
4357
uses: docker/setup-qemu-action@v3
4458

4559
- name: Setup Buildx
4660
id: buildx
4761
uses: docker/setup-buildx-action@v3
4862

4963
- name: Hub login
50-
id: login1
5164
uses: docker/login-action@v3
5265
if: github.event_name != 'pull_request'
5366
with:
5467
username: ${{ secrets.DOCKER_USERNAME }}
5568
password: ${{ secrets.DOCKER_PASSWORD }}
5669

5770
- name: Quay login
58-
id: login2
5971
uses: docker/login-action@v3
6072
if: github.event_name != 'pull_request'
6173
with:
@@ -64,66 +76,41 @@ jobs:
6476
password: ${{ secrets.QUAY_PASSWORD }}
6577

6678
- name: Ghcr login
67-
id: login3
6879
uses: docker/login-action@v3
6980
if: github.event_name != 'pull_request'
7081
with:
7182
registry: ghcr.io
7283
username: ${{ github.actor }}
7384
password: ${{ secrets.GITHUB_TOKEN }}
7485

75-
- name: Build amd64
76-
id: amd64
86+
- name: Build image
7787
uses: docker/build-push-action@v6
7888
with:
7989
builder: ${{ steps.buildx.outputs.name }}
8090
context: latest/
8191
provenance: false
82-
file: latest/Dockerfile.amd64
83-
platforms: linux/amd64
92+
file: latest/Dockerfile.${{ matrix.variant.arch }}
93+
platforms: ${{ matrix.variant.platform }}
8494
push: ${{ github.event_name != 'pull_request' }}
8595
labels: ${{ steps.meta.outputs.labels }}
8696
tags: |
87-
webhippie/python:latest-amd64
88-
quay.io/webhippie/python:latest-amd64
89-
ghcr.io/dockhippie/python:latest-amd64
97+
webhippie/python:latest-${{ matrix.variant.arch }}
98+
quay.io/webhippie/python:latest-${{ matrix.variant.arch }}
99+
ghcr.io/dockhippie/python:latest-${{ matrix.variant.arch }}
90100
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/python:latest-arm64
104-
quay.io/webhippie/python:latest-arm64
105-
ghcr.io/dockhippie/python:latest-arm64
101+
manifest:
102+
runs-on: ubuntu-latest
103+
if: github.event_name != 'pull_request'
106104

107-
- name: Build arm
108-
id: arm
109-
uses: docker/build-push-action@v6
110-
with:
111-
builder: ${{ steps.buildx.outputs.name }}
112-
context: latest/
113-
provenance: false
114-
file: latest/Dockerfile.arm
115-
platforms: linux/arm/v6
116-
push: ${{ github.event_name != 'pull_request' }}
117-
labels: ${{ steps.meta.outputs.labels }}
118-
tags: |
119-
webhippie/python:latest-arm
120-
quay.io/webhippie/python:latest-arm
121-
ghcr.io/dockhippie/python:latest-arm
105+
needs:
106+
- docker
107+
108+
steps:
109+
- name: Checkout source
110+
uses: actions/checkout@v5
122111

123112
- name: Hub manifest
124-
id: manifest1
125113
uses: actionhippie/manifest@v1
126-
if: github.event_name != 'pull_request'
127114
with:
128115
username: ${{ secrets.DOCKER_USERNAME }}
129116
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -133,9 +120,7 @@ jobs:
133120
ignore_missing: true
134121

135122
- name: Quay manifest
136-
id: manifest2
137123
uses: actionhippie/manifest@v1
138-
if: github.event_name != 'pull_request'
139124
with:
140125
username: ${{ secrets.QUAY_USERNAME }}
141126
password: ${{ secrets.QUAY_PASSWORD }}
@@ -145,9 +130,7 @@ jobs:
145130
ignore_missing: true
146131

147132
- name: Ghcr manifest
148-
id: manifest3
149133
uses: actionhippie/manifest@v1
150-
if: github.event_name != 'pull_request'
151134
with:
152135
username: ${{ github.actor }}
153136
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/python
2624
username: ${{ secrets.DOCKER_USERNAME }}
2725
password: ${{ secrets.DOCKER_PASSWORD }}
28-
description: Docker image for python
26+
description: Docker image for Python
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)