Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
uses: actions/setup-go@v6
with:
go-version: ^1.24
id: go

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Get dependencies
run: |
Expand All @@ -42,11 +42,11 @@ jobs:
matrix:
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
name: Checkout repository

- name: setup node ${{matrix.node-version}}
uses: actions/setup-node@v3
uses: actions/setup-node@v5
with:
node-version: ${{matrix.node-version}}

Expand All @@ -56,4 +56,4 @@ jobs:

- name: Build
run: yarn build
working-directory: html-report/ui
working-directory: html-report/ui
38 changes: 26 additions & 12 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:

steps:
- name: Checkout code from repo
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
id: go
with:
go-version: ^1.24

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
Expand All @@ -38,17 +38,17 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v5

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

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

- name: Use Node.js 20
uses: actions/setup-node@v3
uses: actions/setup-node@v5
with:
node-version: 20
registry-url: https://registry.npmjs.org/
Expand All @@ -57,6 +57,7 @@ jobs:
run: |
git config --global user.name "pb33f github bot"
git config --global user.email "github-bot@pb33f.io"

- name: Create .npmrc file
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
Expand All @@ -79,32 +80,45 @@ jobs:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v2
uses: docker/metadata-action@v5
with:
images: |
pb33f/openapi-changes
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.event.client_payload.new-tag }}
type=raw,value=latest

- name: Build and push Docker images
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: pb33f/openapi-changes:${{ github.event.client_payload.new-tag }}, pb33f/openapi-changes:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- uses: actions-ecosystem/action-get-merged-pull-request@v1
id: get-merged-pull-request
Expand Down
6 changes: 6 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ builds:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
archives:
- name_template: >-
{{ .ProjectName }}_
Expand Down
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM golang:1.24-bookworm as builder
FROM --platform=$BUILDPLATFORM golang:1.24-bookworm as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

RUN mkdir -p /opt/openapi-changes

Expand All @@ -7,13 +12,12 @@ WORKDIR /opt/openapi-changes
COPY . ./

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

FROM debian:bookworm-slim
RUN apt-get update
RUN apt-get --yes install git
FROM --platform=$TARGETPLATFORM debian:bookworm-slim
RUN apt-get update && apt-get --yes install git && rm -rf /var/lib/apt/lists/*
WORKDIR /work
COPY --from=0 /openapi-changes /
COPY --from=builder /openapi-changes /

ENV PATH=$PATH:/

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ curl -fsSL https://pb33f.io/openapi-changes/install.sh | sh
docker pull pb33f/openapi-changes
```

Docker images are available for both `linux/amd64` and `linux/arm64` architectures.

To run, mount the current working dir to the container like so:

```
Expand Down
Loading