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
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
/vendor
vendor
dist
45 changes: 45 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
project_name: skpr-api
version: 2

builds:
- id: skpr-apiserver-mock
main: ./cmd/apiserver-mock
binary: skpr-apiserver-mock
ldflags:
- -extldflags '-static'
env:
- CGO_ENABLED=0
goos: [ linux ]
goarch: [ amd64, arm64 ]

dockers:
- dockerfile: dockerfiles/apiserver-mock/Dockerfile
image_templates:
- "ghcr.io/skpr/api:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/skpr/api:latest-amd64"
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
use: buildx
- dockerfile: dockerfiles/apiserver-mock/Dockerfile
image_templates:
- "ghcr.io/skpr/api:{{ .Major }}.{{ .Minor }}-arm64"
- "ghcr.io/skpr/api:latest-arm64"
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
use: buildx
goarch: arm64

docker_manifests:
- name_template: "ghcr.io/skpr/api:{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/skpr/api:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/skpr/api:{{ .Major }}.{{ .Minor }}-arm64"
- name_template: "ghcr.io/skpr/api:latest"
image_templates:
- "ghcr.io/skpr/api:latest-amd64"
- "ghcr.io/skpr/api:latest-arm64"

release:
draft: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:
rm -fR $(DIR)
mkdir -p $(DIR)
# Building image.
docker build -t $(IMAGE) .
docker build -t $(IMAGE) dockerfiles/grpc-go
# Building package.
docker run -it -w $(PWD) -v $(PWD):$(PWD) $(IMAGE) /bin/bash -c 'protoc --go_out=./pb --go_opt=paths=source_relative --go-grpc_out=./pb --go-grpc_opt=paths=source_relative *.proto'

Expand Down
5 changes: 5 additions & 0 deletions dockerfiles/apiserver-mock/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:latest

COPY skpr-apiserver-mock /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/skpr-apiserver-mock"]
File renamed without changes.