Skip to content

Commit

Permalink
Merge pull request #2 from Simplifi-ED/fix/docker
Browse files Browse the repository at this point in the history
fix 🐛 (goreleaser): dockers and docker-manifest fixes
  • Loading branch information
muandane authored Dec 21, 2023
2 parents d62e372 + eb4d4cb commit 981ae9b
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 31 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/go-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ permissions:
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Check out code
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Docker Setup QEMU
uses: docker/[email protected]
- name: Docker Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PUBLISHER_TOKEN }}

- name: Set up Go
uses: actions/[email protected]
with:
Expand All @@ -24,9 +36,7 @@ jobs:
name: Run GoReleaser
uses: goreleaser/[email protected]
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
version: latest
args: release --clean
workdir: ./
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ linters-settings:
regexp:
PROJECT: 'Akslifecycle'
template: |-
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: GPL-3.0
Copyright Authors of {{ PROJECT }}
gosec:
includes:
Expand Down
39 changes: 17 additions & 22 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ builds:
- arm64
env:
- CGO_ENABLED=0
# ldflags:
# - -s -w -X github.com/muandane/akslifecycle/cmd.version={{.Version}}
ldflags:
- -s -w

release:
prerelease: auto
Expand All @@ -40,17 +40,18 @@ checksum:

dockers:
- use: buildx
goos: linux
goarch: amd64
image_templates:
- "simplifi-ed/{{ .ProjectName }}:{{ .Version }}-amd64"
- "simplifi-ed/{{ .ProjectName }}:latest-amd64"
- "ghcr.io/simplifi-ed/{{ .ProjectName }}:{{ .Version }}-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.description={{ .ProjectName }}"
- "--label=org.opencontainers.image.url=https://github.com/Simplifi-ED/{{ .ProjectName }}"
- "--label=org.opencontainers.image.source=https://github.com/Simplifi-ED/{{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.licenses=GPL-3.0"
extra_files:
- go.mod
- go.sum
Expand All @@ -60,17 +61,19 @@ dockers:
- cmd/root.go
- main.go
- use: buildx
goos: linux
goarch: arm64
image_templates:
- "simplifi-ed/{{ .ProjectName }}:{{ .Version }}-armv64"
- "simplifi-ed/{{ .ProjectName }}:latest-armv7"
- "ghcr.io/simplifi-ed/{{ .ProjectName }}:{{ .Version }}-arm64v8"
build_flag_templates:
- "--platform=linux/arm64"
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.description={{ .ProjectName }}"
- "--label=org.opencontainers.image.url=https://github.com/Simplifi-ED/{{ .ProjectName }}"
- "--label=org.opencontainers.image.source=https://github.com/Simplifi-ED/{{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.licenses=GPL-3.0"
extra_files:
- go.mod
- go.sum
Expand All @@ -79,18 +82,10 @@ dockers:
- internal/azure.go
- cmd/root.go
- main.go

docker_manifests:
- name_template: simplifi-ed/{{ .ProjectName }}:{{ .Version }}
image_templates:
- simplifi-ed/{{ .ProjectName }}:{{ .Version }}-amd64
- simplifi-ed/{{ .ProjectName }}:{{ .Version }}-armv64
- name_template: simplifi-ed/{{ .ProjectName }}:latest
- name_template: ghcr.io/simplifi-ed/{{ .ProjectName }}:{{ .Version }}
image_templates:
- simplifi-ed/{{ .ProjectName }}:latest-amd64
- simplifi-ed/{{ .ProjectName }}:latest-armv64

snapshot:
name_template: "{{ incpatch .Version }}-SNAPSHOT"
- ghcr.io/simplifi-ed/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/simplifi-ed/{{ .ProjectName }}:{{ .Version }}-arm64v8

source:
enabled: true
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: GPL-3.0
// Copyright Authors of Akslifecycle

package cmd
Expand Down
2 changes: 1 addition & 1 deletion internal/azure.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: GPL-3.0
// Copyright Authors of Akslifecycle

package internal
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: GPL-3.0
// Copyright Authors of Akslifecycle

package main
Expand Down
2 changes: 1 addition & 1 deletion utils/lifecycle/startNode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: GPL-3.0
// Copyright Authors of Akslifecycle

package lifecycle
Expand Down
2 changes: 1 addition & 1 deletion utils/lifecycle/stopNode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: GPL-3.0
// Copyright Authors of Akslifecycle

package lifecycle
Expand Down

0 comments on commit 981ae9b

Please sign in to comment.