Skip to content

Commit f481c43

Browse files
feat: updates (#2)
feat: updating packages feat: adding trivy scans feat: update golang version fix: build process since we forked the repo fix: build process to work with GHCR feat: cleanup old container images chore: update docker compose
1 parent 87f8d8e commit f481c43

11 files changed

Lines changed: 390 additions & 225 deletions

File tree

.github/configs/labeler.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
####
2+
## This is managed via https://github.com/internal-GlueOps/github-shared-files-sync . Any changes to this file may be overridden by our automation
3+
####
4+
5+
include-in-release-notes:
6+
- changed-files:
7+
- any-glob-to-any-file: '**'

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
####
2+
## This is managed via https://github.com/internal-GlueOps/github-shared-files-sync . Any changes to this file may be overridden by our automation
3+
####
4+
5+
changelog:
6+
exclude:
7+
labels:
8+
- 'ignore'
9+
# authors:
10+
# - 'glueops-terraform-svc-account'
11+
# - 'glueops-svc-account'
12+
# - 'glueops-renovatebot'
13+
categories:
14+
- title: Breaking Changes 🛠
15+
labels:
16+
- 'major'
17+
- 'breaking-change'
18+
- title: Enhancements 🎉
19+
labels:
20+
- 'minor'
21+
- 'enhancement'
22+
- 'new-feature'
23+
- title: Other 🐛
24+
labels:
25+
- 'auto-update'
26+
- 'patch'
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- 'hotfix'
31+
- 'dependencies'
32+
- 'include-in-release-notes'

.github/workflows/build.yml

Lines changed: 104 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -5,113 +5,127 @@ on:
55
push:
66
branches:
77
- main
8+
- '**'
89
tags:
910
- v*
1011
pull_request:
1112
branches:
1213
- main
1314

1415
env:
16+
REGISTRY: ghcr.io
17+
IMAGE_NAME: ${{ github.repository }}
1518
PLATFORMS: |
1619
linux/arm/v7
1720
linux/arm64
1821
linux/amd64
19-
TAGS: |
20-
type=schedule
21-
type=ref,event=branch
22-
type=ref,event=tag
23-
type=ref,event=pr
24-
type=sha,prefix=,suffix=,format=long
2522
2623
jobs:
2724
test:
2825
runs-on: ubuntu-24.04
2926
steps:
30-
- name: Set up Go
31-
uses: actions/setup-go@v3
32-
with:
33-
go-version: 1.24
34-
- name: Checkout repo
35-
uses: actions/checkout@v3
36-
- name: Lint the codebase
37-
uses: golangci/golangci-lint-action@v8
38-
with:
39-
version: latest
40-
- name: Run tests
41-
run: |
42-
go test -v ./... -cover -race -coverprofile=coverage.out
43-
go tool cover -func=coverage.out -o=coverage.out
27+
- name: Set up Go
28+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
29+
with:
30+
go-version: "1.25"
31+
- name: Checkout repo
32+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
33+
- name: Lint the codebase
34+
uses: golangci/golangci-lint-action@v8
35+
with:
36+
version: latest
37+
- name: Run tests
38+
run: |
39+
go test -v ./... -cover -race -coverprofile=coverage.out
40+
go tool cover -func=coverage.out -o=coverage.out
41+
4442
build:
4543
runs-on: ubuntu-24.04
4644
needs: test
45+
permissions:
46+
contents: read
47+
packages: write
4748
steps:
48-
- name: Checkout repo
49-
uses: actions/checkout@v3
50-
- name: Set up QEMU
51-
uses: docker/setup-qemu-action@v2
52-
with:
53-
platforms: all
54-
- name: Set up Docker Buildx
55-
id: buildx
56-
uses: docker/setup-buildx-action@v2
57-
with:
58-
version: latest
59-
- name: Login to Docker Hub
60-
if: ${{ github.actor == github.repository_owner }}
61-
uses: docker/login-action@v2
62-
with:
63-
username: ${{ secrets.DOCKER_USERNAME }}
64-
password: ${{ secrets.DOCKER_PASSWORD }}
65-
- name: Collect image metadata
66-
id: meta
67-
uses: docker/metadata-action@v4
68-
with:
69-
images: ${{ github.repository }}
70-
tags: ${{ env.TAGS }}
71-
- name: Collect build image metadata
72-
id: buildmeta
73-
uses: docker/metadata-action@v4
74-
with:
75-
images: ${{ github.repository }}-build-image
76-
tags: ${{ env.TAGS }}
77-
- name: Build and push release
78-
uses: docker/build-push-action@v3
79-
with:
80-
context: .
81-
push: ${{ github.actor == github.repository_owner }}
82-
load: ${{ github.actor != github.repository_owner }}
83-
tags: ${{ steps.meta.outputs.tags }}
84-
labels: ${{ steps.meta.outputs.labels }}
85-
target: release
86-
cache-from: |
87-
${{ github.repository }}-cache
88-
cache-to: |
89-
${{ github.actor == github.repository_owner && format('type=registry,ref={0}-cache,mode=max', github.repository) || '' }}
90-
platforms: ${{ github.actor == github.repository_owner && env.PLATFORMS || 'linux/amd64' }}
91-
build-args: |
92-
DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
93-
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
94-
COMMIT=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
95-
REPOSITORY=${{ github.repository }}
96-
- name: Build and push build image
97-
uses: docker/build-push-action@v3
98-
with:
99-
context: .
100-
push: ${{ github.actor == github.repository_owner }}
101-
load: ${{ github.actor != github.repository_owner }}
102-
tags: ${{ steps.buildmeta.outputs.tags }}
103-
labels: ${{ steps.buildmeta.outputs.labels }}
104-
target: build-image
105-
cache-from: |
106-
${{ github.repository }}-cache
107-
cache-to: |
108-
${{ github.actor == github.repository_owner && format('type=registry,ref={0}-cache,mode=max', github.repository) || '' }}
109-
platforms: ${{ github.actor == github.repository_owner && env.PLATFORMS || 'linux/amd64' }}
110-
build-args: |
111-
DATE=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.created'] }}
112-
VERSION=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.version'] }}
113-
COMMIT=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.revision'] }}
114-
REPOSITORY=${{ github.repository }}
115-
- name: Get version info
116-
run: |
117-
docker run --rm ${{ github.repository }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} -v
49+
- name: Checkout repo
50+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
51+
52+
- name: Set up QEMU
53+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
54+
55+
- name: Setup Docker buildx
56+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
57+
58+
- name: Log into registry ${{ env.REGISTRY }}
59+
if: github.event_name != 'pull_request'
60+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
61+
with:
62+
registry: ${{ env.REGISTRY }}
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Extract Docker metadata
67+
id: meta
68+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
69+
with:
70+
github-token: ${{ secrets.GITHUB_TOKEN }}
71+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
72+
tags: |
73+
type=ref,event=branch,prefix=
74+
type=ref,event=tag,prefix=
75+
type=sha,format=short,prefix=
76+
type=sha,format=long,prefix=
77+
78+
- name: Extract Docker metadata for build image
79+
id: buildmeta
80+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
81+
with:
82+
github-token: ${{ secrets.GITHUB_TOKEN }}
83+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-build-image
84+
tags: |
85+
type=ref,event=branch,prefix=
86+
type=ref,event=tag,prefix=
87+
type=sha,format=short,prefix=
88+
type=sha,format=long,prefix=
89+
90+
- name: Build and push release
91+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
92+
with:
93+
context: .
94+
push: ${{ github.event_name != 'pull_request' }}
95+
load: ${{ github.event_name == 'pull_request' }}
96+
tags: ${{ steps.meta.outputs.tags }}
97+
labels: ${{ steps.meta.outputs.labels }}
98+
target: release
99+
platforms: ${{ github.event_name != 'pull_request' && env.PLATFORMS || 'linux/amd64' }}
100+
provenance: false
101+
cache-from: type=gha
102+
cache-to: type=gha,mode=max
103+
build-args: |
104+
DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
105+
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
106+
COMMIT=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
107+
REPOSITORY=${{ github.repository }}
108+
109+
- name: Build and push build image
110+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
111+
with:
112+
context: .
113+
push: ${{ github.event_name != 'pull_request' }}
114+
load: ${{ github.event_name == 'pull_request' }}
115+
tags: ${{ steps.buildmeta.outputs.tags }}
116+
labels: ${{ steps.buildmeta.outputs.labels }}
117+
target: build-image
118+
platforms: ${{ github.event_name != 'pull_request' && env.PLATFORMS || 'linux/amd64' }}
119+
provenance: false
120+
cache-from: type=gha
121+
cache-to: type=gha,mode=max
122+
build-args: |
123+
DATE=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.created'] }}
124+
VERSION=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.version'] }}
125+
COMMIT=${{ fromJSON(steps.buildmeta.outputs.json).labels['org.opencontainers.image.revision'] }}
126+
REPOSITORY=${{ github.repository }}
127+
128+
- name: Get version info
129+
if: github.event_name == 'pull_request'
130+
run: |
131+
docker run --rm ${{ fromJSON(steps.meta.outputs.json).tags[0] }} -v

.github/workflows/cleanup-ghcr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Cleanup old container images
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Weekly on Sunday
6+
workflow_dispatch:
7+
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
steps:
14+
- name: Delete old container images
15+
uses: snok/container-retention-policy@v3.0.1
16+
with:
17+
account: ${{ github.repository_owner }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
image-names: "sish,sish-build-image"
20+
cut-off: 2 weeks ago UTC
21+
keep-n-most-recent: 10
22+
skip-shas: true
23+
skip-tags: "latest,main,v*"

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
docs:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1111
- name: Set outputs
1212
id: vars
1313
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
14-
- uses: actions/setup-go@v4
14+
- uses: actions/setup-go@v5
1515
with:
16-
go-version: 1.24
16+
go-version: "1.25"
1717
- name: build docs site
1818
run: make ssg
1919
- name: publish to pgs

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ jobs:
88
runs-on: ubuntu-24.04
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- name: Set up Go
15-
uses: actions/setup-go@v2
15+
uses: actions/setup-go@v5
1616
with:
17-
go-version: 1.24
17+
go-version: "1.25"
1818
- name: Run GoReleaser
19-
uses: goreleaser/goreleaser-action@v2
19+
uses: goreleaser/goreleaser-action@v6
2020
with:
2121
version: latest
2222
args: release --clean

0 commit comments

Comments
 (0)