diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cac304..ee91ff1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - # TODO: signing ? - #- uses: sigstore/cosign-installer@v3.7.0 + - name: Set up Go + uses: actions/setup-go@v5 - uses: docker/login-action@v3 with: @@ -25,6 +27,12 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Release uses: goreleaser/goreleaser-action@v6.3.0 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 2548af3..3e8b04f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,5 @@ version: 2 +project_name: nomad-job-exec before: hooks: - go mod download @@ -10,8 +11,34 @@ builds: - windows - darwin dockers: - - image_templates: - - "ghcr.io/edgelaboratories/nomad-job-exec:{{ .Tag }}" + - use: buildx + image_templates: + - "ghcr.io/edgelaboratories/{{ .ProjectName }}:{{ .Tag }}-amd64" + build_flag_templates: + - "--pull" + - "--sbom=true" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/amd64" + - use: buildx + image_templates: + - "ghcr.io/edgelaboratories/{{ .ProjectName }}:{{ .Tag }}-arm64" + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/arm64" +docker_manifests: + - name_template: "ghcr.io/edgelaboratories/{{ .ProjectName }}:{{ .Tag }}" + image_templates: + - "ghcr.io/edgelaboratories/{{ .ProjectName }}:{{ .Tag }}-amd64" + - "ghcr.io/edgelaboratories/{{ .ProjectName }}:{{ .Tag }}-arm64" archives: - id: binary formats: ['binary', 'zip'] diff --git a/go.mod b/go.mod index ea1f0bf..af35d74 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/edgelaboratories/nomad-job-exec -go 1.23.0 +go 1.23.10 toolchain go1.24.5