-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,399 additions
and
282 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=ref,event=branch | ||
- name: Log in to the container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# IntelliJ | ||
.idea/ | ||
|
||
# binary | ||
veidemann-reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
FROM docker.io/golang:latest as golang | ||
FROM docker.io/golang:1.19 as golang | ||
|
||
WORKDIR /build | ||
|
||
COPY . . | ||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN go mod download | ||
|
||
RUN mkdir -p /out | ||
COPY . . | ||
|
||
# Cache builds without version info | ||
RUN go build -mod readonly -o /out/veidemann-reset -ldflags "-s -w" | ||
# Cache build without version info | ||
# -trimpath remove file system paths from executable | ||
# -ldflags arguments passed to go tool link: | ||
# -s disable symbol table | ||
# -w disable DWARF generation | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod readonly -trimpath -ldflags "-s -w" | ||
|
||
ARG VERSION | ||
RUN go build -mod readonly -o /out/veidemann-reset \ | ||
-ldflags "-s -w -X github.com/nlnwa/veidemann-reset/pkg/version.Version=${VERSION:-$(git describe --tags --always)}" | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod readonly -trimpath \ | ||
-ldflags "-s -w -X github.com/nlnwa/veidemann-reset/internal/version.Version=${VERSION:-$(git describe --tags --always)}" | ||
|
||
|
||
FROM gcr.io/distroless/base | ||
FROM gcr.io/distroless/base-debian11 | ||
|
||
COPY LICENSE /LICENSE | ||
|
||
COPY --from=golang /out /out | ||
COPY --from=golang /build/veidemann-reset /veidemann-reset | ||
|
||
ENTRYPOINT ["/out/veidemann-reset"] | ||
ENTRYPOINT ["/veidemann-reset"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.