Skip to content

Commit b48314a

Browse files
🎨 Update workflows (#98)
Co-authored-by: ChristophShyper <[email protected]>
1 parent 64e435e commit b48314a

14 files changed

+521
-167
lines changed

.dockerignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33

44
# Include
5-
!LICENSE
6-
!entrypoint.sh
75
!Dockerfile
6+
!entrypoint.sh
7+
!LICENSE
88
!README.md

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,3 @@ updates:
1919
- ChristophShyper
2020
labels:
2121
- automatic
22-
23-
# # Enable version updates for pip
24-
# - package-ecosystem: pip
25-
# directory: /
26-
# schedule:
27-
# interval: daily
28-
# assignees:
29-
# - ChristophShyper
30-
# labels:
31-
# - automatic

.github/workflows/pull-request.yml renamed to .github/workflows/auto-create-pull-request.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request
1+
name: (Auto) Create Pull Request
22

33
on:
44
push:
@@ -31,9 +31,9 @@ jobs:
3131
run: task lint
3232

3333
build-and-push:
34-
name: Build and Push test
35-
needs: [lint]
34+
name: Build and push
3635
runs-on: ubuntu-24.04-arm
36+
needs: [lint]
3737
steps:
3838
- name: Checkout
3939
uses: actions/checkout@v5
@@ -46,23 +46,29 @@ jobs:
4646
with:
4747
version: 3.x
4848

49-
- name: Docker Buildx
49+
- name: Install Docker Buildx
5050
uses: docker/setup-buildx-action@v3
5151
with:
5252
install: true
5353

54-
- name: QEMU
54+
- name: Install QEMU
5555
uses: docker/setup-qemu-action@v3
5656
with:
5757
image: tonistiigi/binfmt:latest
5858
platforms: amd64,arm64
5959

60+
- name: Get Docker commands
61+
run: task docker:cmds
62+
6063
- name: Build and push test image
6164
env:
6265
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
6366
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6467
run: task docker:push
6568

69+
- name: Inspect image
70+
run: task docker:push:inspect
71+
6672
pull-request:
6773
name: Pull Request
6874
runs-on: ubuntu-24.04-arm
@@ -73,14 +79,16 @@ jobs:
7379
fetch-depth: 0
7480
fetch-tags: true
7581

76-
- name: Template
77-
shell: bash
78-
run: |
79-
mkdir -p .tmp
80-
curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/PULL_REQUEST_TEMPLATE.md -o .tmp/PULL_REQUEST_TEMPLATE.md
82+
- name: Install Task
83+
uses: arduino/[email protected]
84+
with:
85+
version: 3.x
86+
87+
- name: Get template
88+
run: task git:get-pr-template
8189

8290
- name: Create Pull Request
83-
uses: devops-infra/action-pull-request@v0.6
91+
uses: devops-infra/action-pull-request@v1
8492
with:
8593
github_token: ${{ secrets.GITHUB_TOKEN }}
8694
assignee: ${{ github.actor }}

.github/workflows/release.yml renamed to .github/workflows/auto-create-release.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: Manual Release
1+
name: (Auto) Create release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: Release version (e.g., v1.2.3)
8-
required: true
9-
type: string
4+
pull_request:
5+
types: [closed]
6+
push:
7+
branches:
8+
- release/**
109

1110
permissions:
1211
contents: write
1312
packages: write
1413

1514
jobs:
1615
release:
16+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
1717
name: Create Release
1818
runs-on: ubuntu-24.04-arm
1919
steps:
@@ -29,12 +29,14 @@ jobs:
2929
version: 3.x
3030

3131
- name: Create and push git tags
32+
id: version
3233
env:
33-
VERSION: ${{ github.event.inputs.version }}
34+
VERSION_SUFFIX: ""
3435
run: |
35-
git config user.name "github-actions[bot]"
36-
git config user.email "github-actions[bot]@users.noreply.github.com"
36+
task lint
37+
task git:set-config
3738
task version:tag-release
39+
echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT"
3840
3941
- name: Install Docker Buildx
4042
uses: docker/setup-buildx-action@v3
@@ -47,26 +49,35 @@ jobs:
4749
image: tonistiigi/binfmt:latest
4850
platforms: amd64,arm64
4951

50-
- name: Build and push Docker images
52+
- name: Get Docker commands
53+
env:
54+
VERSION_SUFFIX: ""
55+
run: task docker:cmds
56+
57+
- name: Build and Push
5158
env:
5259
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
5360
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
VERSION: ${{ github.event.inputs.version }}
5561
VERSION_SUFFIX: ""
5662
run: task docker:push
5763

58-
- name: Create GitHub Release
64+
- name: Inspect image
65+
env:
66+
VERSION_SUFFIX: ""
67+
run: task docker:push:inspect
68+
69+
- name: Create GitHub release
5970
uses: softprops/action-gh-release@v2
6071
with:
61-
tag_name: ${{ github.event.inputs.version }}
62-
name: ${{ github.event.inputs.version }}
72+
tag_name: ${{ steps.version.outputs.REL_VERSION }}
73+
name: ${{ steps.version.outputs.REL_VERSION }}
6374
draft: false
6475
prerelease: false
6576
generate_release_notes: true
6677
env:
6778
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6879

69-
- name: Update Docker Hub description
80+
- name: Update Docker hub description
7081
uses: peter-evans/dockerhub-description@v5
7182
with:
7283
username: ${{ vars.DOCKER_USERNAME }}
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Weekly Dependency Check
1+
name: (Cron) Check dependencies
22

33
on:
44
schedule:
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
dependency-check:
14-
name: Test Dependencies
14+
name: Test dependencies
1515
runs-on: ubuntu-24.04-arm
1616
steps:
1717
- name: Checkout
@@ -20,25 +20,30 @@ jobs:
2020
fetch-depth: 0
2121
fetch-tags: true
2222

23-
2423
- name: Install Task
2524
uses: arduino/[email protected]
2625
with:
2726
version: 3.x
2827

29-
- name: Docker Buildx
28+
- name: Install Docker Buildx
3029
uses: docker/setup-buildx-action@v3
3130
with:
3231
install: true
3332

34-
- name: QEMU
33+
- name: Install QEMU
3534
uses: docker/setup-qemu-action@v3
3635
with:
3736
image: tonistiigi/binfmt:latest
3837
platforms: amd64,arm64
3938

40-
- name: Build & push test image
41-
env:
42-
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Run linters
40+
run: task lint
41+
42+
- name: Get Docker commands
43+
run: task docker:cmds
44+
45+
- name: Build and push test image
4446
run: task docker:push
47+
48+
- name: Inspect image
49+
run: task docker:push:inspect
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: (Manual) Update Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
type:
7+
description: Bump type
8+
required: true
9+
default: patch
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
- set
16+
version:
17+
description: Explicit version when type="set" (e.g., v1.2.3)
18+
required: false
19+
default: ''
20+
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
packages: write
25+
26+
jobs:
27+
update:
28+
name: Update version and push release branch
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v5
33+
with:
34+
fetch-depth: 0
35+
fetch-tags: true
36+
37+
- name: Install Task
38+
uses: arduino/[email protected]
39+
with:
40+
version: 3.x
41+
42+
- name: Update version
43+
id: version
44+
env:
45+
BUMP_TYPE: ${{ github.event.inputs.type }}
46+
INPUT_VERSION: ${{ github.event.inputs.version }}
47+
run: |
48+
set -eux
49+
case "${BUMP_TYPE}" in
50+
set)
51+
if [ -z "${INPUT_VERSION}" ]; then
52+
echo "Missing version for type=set"
53+
exit 1
54+
fi
55+
task version:set VERSION_OVERRIDE="${INPUT_VERSION}"
56+
;;
57+
patch)
58+
task version:update:patch
59+
;;
60+
minor)
61+
task version:update:minor
62+
;;
63+
major)
64+
task version:update:major
65+
;;
66+
*)
67+
echo "Unknown type: ${BUMP_TYPE}"
68+
exit 1
69+
;;
70+
esac
71+
echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT"
72+
73+
- name: Install Docker Buildx
74+
uses: docker/setup-buildx-action@v3
75+
with:
76+
install: true
77+
78+
- name: Install QEMU
79+
uses: docker/setup-qemu-action@v3
80+
with:
81+
image: tonistiigi/binfmt:latest
82+
platforms: amd64,arm64
83+
84+
- name: Get Docker commands
85+
run: task docker:cmds
86+
87+
- name: Build and push test image
88+
env:
89+
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
run: task docker:push
92+
93+
- name: Inspect image
94+
run: task docker:push:inspect
95+
96+
- name: Get template
97+
env:
98+
VERSION_SUFFIX: ""
99+
run: |
100+
task git:set-config
101+
task git:get-pr-template
102+
103+
- name: Push to release branch
104+
uses: devops-infra/action-commit-push@v1
105+
with:
106+
github_token: ${{ secrets.GITHUB_TOKEN }}
107+
commit_message: ":rocket: Bump version to ${{ steps.version.outputs.REL_VERSION }}"
108+
target_branch: ${{ format('release/{0}', steps.version.outputs.REL_VERSION) }}
109+
110+
- name: Create Pull Request
111+
uses: devops-infra/action-pull-request@v1
112+
with:
113+
github_token: ${{ secrets.GITHUB_TOKEN }}
114+
assignee: ${{ github.actor }}
115+
template: .tmp/PULL_REQUEST_TEMPLATE.md
116+
get_diff: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44

55
# Custom
66
.tmp/
7+
.venv
8+
.venv/
9+
.envrc
10+
.env

.hadolint.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
failure-threshold: warning
1+
failure-threshold: error
22
format: tty
3+
strict-labels: false
4+
no-color: false
5+
no-fail: false
6+
disable-ignore-pragma: false
7+
trustedRegistries:
8+
- docker.io
9+
- ghcr.io
10+
311
# ignored: [string]
412
# label-schema:
513
# author: text
@@ -9,13 +17,8 @@ format: tty
917
# documentation: url
1018
# git-revision: hash
1119
# license: spdx
12-
no-color: false
13-
# no-fail: boolean
1420
# override:
1521
# error: [string]
1622
# warning: [string]
1723
# info: [string]
1824
# style: [string]
19-
strict-labels: false
20-
disable-ignore-pragma: false
21-
trustedRegistries: [docker.io]

0 commit comments

Comments
 (0)