Skip to content

Commit 4408750

Browse files
authored
feat: Added automation to create release from tag (#114)
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
1 parent 774cf0e commit 4408750

File tree

4 files changed

+81
-41
lines changed

4 files changed

+81
-41
lines changed

.github/dependabot.yml

+20-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,26 @@
88

99
version: 2
1010
updates:
11-
- package-ecosystem: "gomod"
12-
directory: "/"
11+
- package-ecosystem: github-actions
12+
directory: /
13+
groups:
14+
github-actions:
15+
patterns:
16+
- "*"
17+
update-types:
18+
- minor
19+
- patch
1320
schedule:
14-
interval: "weekly"
21+
interval: weekly
1522

16-
- package-ecosystem: "github-actions"
17-
directory: "/"
23+
- package-ecosystem: gomod
24+
directory: /
25+
groups:
26+
gomod:
27+
patterns:
28+
- "*"
29+
update-types:
30+
- minor
31+
- patch
1832
schedule:
19-
interval: "weekly"
33+
interval: weekly

.github/release.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
changelog:
2+
categories:
3+
- title: Changes
4+
labels:
5+
- "*"
6+
exclude:
7+
labels:
8+
- dependencies
9+
- title: Dependencies
10+
labels:
11+
- dependencies

.github/workflows/build_pr.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@ on:
33
pull_request:
44
branches:
55
- main
6+
7+
permissions: read-all
8+
69
jobs:
710
build:
811
runs-on: ubuntu-22.04
912
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v4
12-
13-
- name: Set up QEMU
14-
uses: docker/setup-qemu-action@v3
13+
- name: Checkout code
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
1518

16-
- name: Set up Docker Buildx
17-
uses: docker/setup-buildx-action@v3
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
1821

19-
- name: Build image
20-
run: |
21-
docker buildx build \
22-
--platform linux/arm64/v8,linux/amd64,linux/arm,linux/ppc64le,linux/s390x \
23-
--build-arg GO_VERSION=$(grep -m 1 go go.mod | cut -d\ -f2) \
24-
-t ghcr.io/jimmidyson/configmap-reload:${{ github.event.pull_request.head.sha }} \
25-
.
22+
- name: Build image
23+
run: |
24+
docker buildx build \
25+
--platform linux/arm64/v8,linux/amd64,linux/arm,linux/ppc64le,linux/s390x \
26+
--build-arg GO_VERSION=$(grep -m 1 go go.mod | cut -d\ -f2) \
27+
-t ghcr.io/jimmidyson/configmap-reload:${{ github.event.pull_request.head.sha }} \
28+
.

.github/workflows/build_tag_and_main.yml

+33-21
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,45 @@ on:
55
- main
66
tags:
77
- v*
8+
9+
permissions: read-all
10+
811
jobs:
912
build-and-push:
1013
runs-on: ubuntu-22.04
1114
permissions:
15+
contents: write
1216
packages: write
1317
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v4
16-
17-
- name: Set up QEMU
18-
uses: docker/setup-qemu-action@v3
18+
- name: Checkout code
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
1926

20-
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v3
27+
- name: Login to GitHub Container Registry
28+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ github.token }}
2233

23-
- name: Login to GitHub Container Registry
24-
uses: docker/login-action@v3
25-
with:
26-
registry: ghcr.io
27-
username: ${{ github.actor }}
28-
password: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Build and push image
35+
run: |
36+
docker buildx build \
37+
--platform linux/arm64/v8,linux/amd64,linux/arm,linux/ppc64le,linux/s390x \
38+
--build-arg GO_VERSION=$(grep -m 1 go go.mod | cut -d\ -f2) \
39+
-t ghcr.io/jimmidyson/configmap-reload:${{ github.ref_name == 'main' && 'dev' || github.ref_name }} \
40+
--push \
41+
.
2942
30-
- name: Build and push image
31-
run: |
32-
docker buildx build \
33-
--platform linux/arm64/v8,linux/amd64,linux/arm,linux/ppc64le,linux/s390x \
34-
--build-arg GO_VERSION=$(grep -m 1 go go.mod | cut -d\ -f2) \
35-
-t ghcr.io/jimmidyson/configmap-reload:${{ github.ref_name == 'main' && 'dev' || github.ref_name }} \
36-
--push \
37-
.
43+
- name: Create release
44+
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
45+
if: startsWith(github.ref, 'refs/tags/')
46+
with:
47+
token: ${{ github.token }}
48+
make_latest: true
49+
generate_release_notes: true

0 commit comments

Comments
 (0)