Skip to content

Commit 776fee1

Browse files
frichtarikdaveshanley
authored andcommitted
init
1 parent b7e7bc2 commit 776fee1

File tree

6 files changed

+50
-24
lines changed

6 files changed

+50
-24
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Set up Go 1.x
17-
uses: actions/setup-go@v4
17+
uses: actions/setup-go@v6
1818
with:
1919
go-version: ^1.24
2020
id: go
2121

2222
- name: Checkout code
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v5
2424

2525
- name: Get dependencies
2626
run: |
@@ -42,11 +42,11 @@ jobs:
4242
matrix:
4343
node-version: [ 20.x ]
4444
steps:
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v5
4646
name: Checkout repository
4747

4848
- name: setup node ${{matrix.node-version}}
49-
uses: actions/setup-node@v3
49+
uses: actions/setup-node@v5
5050
with:
5151
node-version: ${{matrix.node-version}}
5252

@@ -56,4 +56,4 @@ jobs:
5656

5757
- name: Build
5858
run: yarn build
59-
working-directory: html-report/ui
59+
working-directory: html-report/ui

.github/workflows/publish.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111

1212
steps:
1313
- name: Checkout code from repo
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v5
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Set up Go
19-
uses: actions/setup-go@v3
19+
uses: actions/setup-go@v6
2020
id: go
2121
with:
2222
go-version: ^1.24
2323

2424
- name: Run GoReleaser
25-
uses: goreleaser/goreleaser-action@v3
25+
uses: goreleaser/goreleaser-action@v6
2626
with:
2727
version: latest
2828
args: release --clean
@@ -38,17 +38,17 @@ jobs:
3838

3939
steps:
4040
- name: Checkout code
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v5
4242

4343
- name: Set version
4444
id: vars
45-
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
45+
run: echo "tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
4646

4747
- name: Check version
4848
run: echo "Version ${{ github.event.client_payload.new-tag }}"
4949

5050
- name: Use Node.js 20
51-
uses: actions/setup-node@v3
51+
uses: actions/setup-node@v5
5252
with:
5353
node-version: 20
5454
registry-url: https://registry.npmjs.org/
@@ -57,6 +57,7 @@ jobs:
5757
run: |
5858
git config --global user.name "pb33f github bot"
5959
git config --global user.email "[email protected]"
60+
6061
- name: Create .npmrc file
6162
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
6263
env:
@@ -79,32 +80,45 @@ jobs:
7980
contents: read
8081
steps:
8182
- name: Check out the repo
82-
uses: actions/checkout@v3
83+
uses: actions/checkout@v5
84+
85+
- name: Set up QEMU
86+
uses: docker/setup-qemu-action@v3
87+
88+
- name: Set up Docker Buildx
89+
uses: docker/setup-buildx-action@v3
8390

8491
- name: Log in to Docker Hub
85-
uses: docker/login-action@v2
92+
uses: docker/login-action@v3
8693
with:
8794
username: ${{ secrets.DOCKER_USERNAME }}
8895
password: ${{ secrets.DOCKER_PASSWORD }}
8996

9097
- name: Log in to the Container registry
91-
uses: docker/login-action@v2
98+
uses: docker/login-action@v3
9299
with:
93100
registry: ghcr.io
94101
username: ${{ github.actor }}
95102
password: ${{ secrets.GITHUB_TOKEN }}
96103

97104
- name: Extract metadata (tags, labels) for Docker
98105
id: meta
99-
uses: docker/metadata-action@v2
106+
uses: docker/metadata-action@v5
100107
with:
101108
images: |
102109
pb33f/openapi-changes
103110
ghcr.io/${{ github.repository }}
111+
tags: |
112+
type=raw,value=${{ github.event.client_payload.new-tag }}
113+
type=raw,value=latest
104114
105115
- name: Build and push Docker images
106-
uses: docker/build-push-action@v4
116+
uses: docker/build-push-action@v6
107117
with:
108118
context: .
119+
platforms: linux/amd64,linux/arm64
109120
push: true
110-
tags: pb33f/openapi-changes:${{ github.event.client_payload.new-tag }}, pb33f/openapi-changes:latest
121+
tags: ${{ steps.meta.outputs.tags }}
122+
labels: ${{ steps.meta.outputs.labels }}
123+
cache-from: type=gha
124+
cache-to: type=gha,mode=max

.github/workflows/tag.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tag:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v5
1414

1515
- uses: actions-ecosystem/action-get-merged-pull-request@v1
1616
id: get-merged-pull-request

.goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ builds:
1010
- linux
1111
- windows
1212
- darwin
13+
goarch:
14+
- amd64
15+
- arm64
16+
ignore:
17+
- goos: windows
18+
goarch: arm64
1319
archives:
1420
- name_template: >-
1521
{{ .ProjectName }}_

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM golang:1.24-bookworm as builder
1+
FROM --platform=$BUILDPLATFORM golang:1.24-bookworm as builder
2+
3+
ARG TARGETPLATFORM
4+
ARG BUILDPLATFORM
5+
ARG TARGETOS
6+
ARG TARGETARCH
27

38
RUN mkdir -p /opt/openapi-changes
49

@@ -7,13 +12,12 @@ WORKDIR /opt/openapi-changes
712
COPY . ./
813

914
RUN go mod download && go mod verify
10-
RUN go build -ldflags="-w -s" -v -o /openapi-changes openapi-changes.go
15+
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s" -v -o /openapi-changes openapi-changes.go
1116

12-
FROM debian:bookworm-slim
13-
RUN apt-get update
14-
RUN apt-get --yes install git
17+
FROM --platform=$TARGETPLATFORM debian:bookworm-slim
18+
RUN apt-get update && apt-get --yes install git && rm -rf /var/lib/apt/lists/*
1519
WORKDIR /work
16-
COPY --from=0 /openapi-changes /
20+
COPY --from=builder /openapi-changes /
1721

1822
ENV PATH=$PATH:/
1923

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ curl -fsSL https://pb33f.io/openapi-changes/install.sh | sh
8888
docker pull pb33f/openapi-changes
8989
```
9090

91+
Docker images are available for both `linux/amd64` and `linux/arm64` architectures.
92+
9193
To run, mount the current working dir to the container like so:
9294

9395
```

0 commit comments

Comments
 (0)