-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: PythonCoderAS <[email protected]>
- Loading branch information
1 parent
a6655b2
commit f67188a
Showing
8 changed files
with
330 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!cmd/ | ||
!go.mod | ||
!go.sum | ||
!main.go |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ name: PR Flow | |
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- "main.go" | ||
- "go.mod" | ||
|
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
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,98 @@ | ||
#@ project_name = 'cloudflare-dynamic-dns' | ||
#@ targets = [ | ||
#@ ("linux", "amd64", ""), | ||
#@ ("linux", "386", ""), | ||
#@ ("linux", "arm64", ""), | ||
#@ ("linux", "arm", "6"), | ||
#@ ("linux", "arm", "7"), | ||
#@ ("linux", "mips", ""), | ||
#@ ("linux", "mipsle", ""), | ||
#@ ("linux", "mips64", ""), | ||
#@ ("linux", "mips64le", ""), | ||
#@ ("darwin", "amd64", ""), | ||
#@ ("darwin", "arm64", ""), | ||
#@ ("windows", "amd64", ""), | ||
#@ ("windows", "386", ""), | ||
#@ ] | ||
#@ versions = [ | ||
#@ '{{ .Tag }}', | ||
#@ '{{ .Major }}', | ||
#@ '{{ .Major }}.{{ .Minor }}', | ||
#@ 'latest', | ||
#@ ] | ||
|
||
#@ base_image = 'ghcr.io/zebradil/' + project_name | ||
|
||
#@ def make_target(os, arch, arm): | ||
#@ target = os + "_" + arch | ||
#@ if arm: | ||
#@ target += "_" + arm | ||
#@ end | ||
#@ return target | ||
#@ end | ||
|
||
#@ def make_image(version, os, arch, arm): | ||
#@ image = base_image + ":" + version + "-" + os + "-" + arch | ||
#@ if arm: | ||
#@ image += "-" + arm | ||
#@ end | ||
#@ return image | ||
#@ end | ||
|
||
#@ def make_platform(os, arch, arm): | ||
#@ platform = "--platform=" + os + "/" + arch | ||
#@ if arm: | ||
#@ platform += "/" + arm | ||
#@ end | ||
#@ return platform | ||
#@ end | ||
|
||
--- | ||
project_name: #@ project_name | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- binary: #@ project_name | ||
env: | ||
- CGO_ENABLED=0 | ||
targets: | ||
#@ for/end os, arch, arm in targets: | ||
- #@ make_target(os, arch, arm) | ||
archives: | ||
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- LICENSE | ||
- README.md | ||
- systemd/* | ||
checksum: | ||
name_template: "checksums.txt" | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
dockers: | ||
#@ for/end os, arch, arm in targets: | ||
- goos: #@ os | ||
goarch: #@ arch | ||
#@ if/end arm: | ||
goarm: #@ arm | ||
image_templates: | ||
#@ for/end version in versions: | ||
- #@ make_image(version, os, arch, arm) | ||
use: buildx | ||
build_flag_templates: | ||
- #@ make_platform(os, arch, arm) | ||
docker_manifests: | ||
#@ for/end version in versions: | ||
- name_template: #@ base_image + ":" + version | ||
image_templates: | ||
#@ for/end os, arch, arm in targets: | ||
- #@ make_image(version, os, arch, arm) |
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,3 @@ | ||
FROM scratch | ||
COPY . / | ||
ENTRYPOINT ["/cloudflare-dynamic-dns"] |
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
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
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,12 @@ | ||
FROM golang:1.21 | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
RUN go build -o bin/cloudflare-dynamic-dns main.go | ||
|
||
ENTRYPOINT ["/app/bin/cloudflare-dynamic-dns"] |