-
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
1 parent
c047962
commit 7517948
Showing
5 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
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,4 @@ | ||
README.md | ||
README.md | ||
.git | ||
.idea | ||
dist/ |
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,39 @@ | ||
name: GoReleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
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,4 +1,5 @@ | ||
.idea | ||
.mem/*.json | ||
unit_coverage.out | ||
shortly | ||
shortly | ||
dist/ |
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,44 @@ | ||
builds: | ||
- env: [CGO_ENABLED=0] | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
dockers: | ||
- image_templates: ["ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }}-amd64"] | ||
dockerfile: Dockerfile | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/amd64 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/burkaydurdu/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/burkaydurdu/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=MIT | ||
- image_templates: ["ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }}-arm64v8"] | ||
goarch: arm64 | ||
dockerfile: Dockerfile | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/arm64/v8 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/burkaydurdu/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/burkaydurdu/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=MIT | ||
docker_manifests: | ||
- name_template: ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }} | ||
image_templates: | ||
- ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }}-arm64v8 | ||
- name_template: ghcr.io/burkaydurdu/{{ .ProjectName }}:latest | ||
image_templates: | ||
- ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/burkaydurdu/{{ .ProjectName }}:{{ .Version }}-arm64v8 |
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,8 +1,12 @@ | ||
FROM golang:1.17.2-alpine as builder | ||
WORKDIR /go/src/app | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
#FROM golang:1.17.2-alpine as builder | ||
#WORKDIR /go/src/app | ||
#COPY . . | ||
#RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
# | ||
#FROM scratch | ||
#COPY --from=builder /go/src/app/app /app | ||
#ENTRYPOINT ["/app"] | ||
|
||
FROM scratch | ||
COPY --from=builder /go/src/app/app /app | ||
COPY shortly /app | ||
ENTRYPOINT ["/app"] |