ADD image build and push
This commit is contained in:
parent
af7c252c4e
commit
ba26e32d7a
8
.github/workflows/tags.yml
vendored
8
.github/workflows/tags.yml
vendored
@ -11,7 +11,8 @@ jobs:
|
|||||||
USERNAME: ${{ vars.USERNAME }}
|
USERNAME: ${{ vars.USERNAME }}
|
||||||
TAG_VERSION: ${{ github.ref_name }}
|
TAG_VERSION: ${{ github.ref_name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
@ -25,11 +26,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Build amd64
|
- name: Build amd64
|
||||||
run: |
|
run: |
|
||||||
GOOS=linux GOARCH=amd64 go build -o bin/ddns_amd64_$TAG_VERSION ./cmd/...
|
export shortsha=`git rev-parse --short HEAD`
|
||||||
|
GOOS=linux GOARCH=amd64 go build -o bin/ddns_amd64_$TAG_VERSION "-X 'main.Shortsha=$shortsha' -X 'main.Version=$TAG_VERSION' -X 'main.Aarch=amd64'" ./cmd/...
|
||||||
|
|
||||||
- name: Build arm64
|
- name: Build arm64
|
||||||
run: |
|
run: |
|
||||||
GOOS=linux GOARCH=arm64 go build -o bin/ddns_arm64_$TAG_VERSION ./cmd/...
|
GOOS=linux GOARCH=arm64 go build -o bin/ddns_arm64_$TAG_VERSION "-X 'main.Shortsha=$shortsha' -X 'main.Version=$TAG_VERSION' -X 'main.Aarch=arm64'" ./cmd/...
|
||||||
|
|
||||||
- name: push generic registry amd64
|
- name: push generic registry amd64
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -22,6 +22,9 @@ var (
|
|||||||
provider string
|
provider string
|
||||||
rID string
|
rID string
|
||||||
comment string
|
comment string
|
||||||
|
Version string
|
||||||
|
Shortsha string
|
||||||
|
Aarch string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -54,8 +57,8 @@ func main() {
|
|||||||
case "prod":
|
case "prod":
|
||||||
lvl.Set(slog.LevelInfo)
|
lvl.Set(slog.LevelInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
log := slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: lvl}))
|
log := slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: lvl}))
|
||||||
|
log = log.With("version", Version, "shortsha", Shortsha, "aarch", Aarch)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
helpmsg := "required flag not provided "
|
helpmsg := "required flag not provided "
|
||||||
if tok == "" {
|
if tok == "" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user