diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cde043f0..e9af3d31 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -78,6 +78,8 @@ jobs: DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD=${{ secrets.DOCKER_PASSWORD }} + - run: echo github.sha=${{ github.sha }} github.event.pull_request.head.sha=${{ github.event.pull_request.head.sha }} + - name: goreleaser release preview run: make release-preview if: "!startsWith(github.ref, 'refs/tags/v')" @@ -85,9 +87,9 @@ jobs: - run: docker image ls - run: > - docker tag ghcr.io/ecadlabs/signatory:${{ github.event.pull_request.head.sha }}-amd64 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-amd64; - docker tag ghcr.io/ecadlabs/signatory:${{ github.event.pull_request.head.sha }}-arm64 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-arm64; - docker tag ghcr.io/ecadlabs/signatory:${{ github.event.pull_request.head.sha }}-armv7 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-armv7; + docker tag ghcr.io/ecadlabs/signatory:${{ github.sha }}-amd64 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-amd64; + docker tag ghcr.io/ecadlabs/signatory:${{ github.sha }}-arm64 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-arm64; + docker tag ghcr.io/ecadlabs/signatory:${{ github.sha }}-armv7 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-armv7; - run: docker image ls @@ -97,7 +99,7 @@ jobs: uses: Noelware/docker-manifest-action@0.3.1 with: inputs: ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }} - images: ${{ format('ghcr.io/ecadlabs/signatory:{0}-amd64,ghcr.io/ecadlabs/signatory:{0}-arm64,ghcr.io/ecadlabs/signatory:{0}-armv7', github.event.pull_request.head.sha ) }} + images: ${{ format('ghcr.io/ecadlabs/signatory:{0}-amd64,ghcr.io/ecadlabs/signatory:{0}-arm64,ghcr.io/ecadlabs/signatory:{0}-armv7', github.head_ref || github.ref_name ) }} push: true if: "!startsWith(github.ref, 'refs/tags/v')" diff --git a/.goreleaser.yml b/.goreleaser.yml index 17f33175..b0f1e0f9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -94,93 +94,93 @@ builds: - '7' # MACOS - - id: signatory-darwin-amd - binary: signatory - env: - - CGO_ENABLED=1 - - CC=o64-clang - - CXX=o64-clang++ - main: ./cmd/signatory/main.go - ldflags: - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' - goos: - - darwin - goarch: - - amd64 - - id: signatory-cli-darwing-amd - binary: signatory-cli - env: - - CGO_ENABLED=1 - - CC=o64-clang - - CXX=o64-clang++ - main: ./cmd/signatory-cli/main.go - ldflags: - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' - goos: - - darwin - goarch: - - amd64 + # - id: signatory-darwin-amd + # binary: signatory + # env: + # - CGO_ENABLED=1 + # - CC=o64-clang + # - CXX=o64-clang++ + # main: ./cmd/signatory/main.go + # ldflags: + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' + # goos: + # - darwin + # goarch: + # - amd64 + # - id: signatory-cli-darwing-amd + # binary: signatory-cli + # env: + # - CGO_ENABLED=1 + # - CC=o64-clang + # - CXX=o64-clang++ + # main: ./cmd/signatory-cli/main.go + # ldflags: + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' + # goos: + # - darwin + # goarch: + # - amd64 - - id: signatory-darwin-arm - binary: signatory - env: - - CGO_ENABLED=1 - - CC=oa64-clang - - CXX=oa64-clang++ - main: ./cmd/signatory/main.go - ldflags: - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' - goos: - - darwin - goarch: - - arm64 - - id: signatory-cli-darwing-arm - binary: signatory-cli - env: - - CGO_ENABLED=1 - - CC=oa64-clang - - CXX=oa64-clang++ - main: ./cmd/signatory-cli/main.go - ldflags: - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' - goos: - - darwin - goarch: - - arm64 + # - id: signatory-darwin-arm + # binary: signatory + # env: + # - CGO_ENABLED=1 + # - CC=oa64-clang + # - CXX=oa64-clang++ + # main: ./cmd/signatory/main.go + # ldflags: + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' + # goos: + # - darwin + # goarch: + # - arm64 + # - id: signatory-cli-darwing-arm + # binary: signatory-cli + # env: + # - CGO_ENABLED=1 + # - CC=oa64-clang + # - CXX=oa64-clang++ + # main: ./cmd/signatory-cli/main.go + # ldflags: + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' + # goos: + # - darwin + # goarch: + # - arm64 # WINDOWS - - id: signatory-windows-amd - binary: signatory - env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ - main: ./cmd/signatory/main.go - ldflags: - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' - goos: - - windows - goarch: - - amd64 - - id: signatory-cli-windows-amd - binary: signatory-cli - env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ - main: ./cmd/signatory-cli/main.go - ldflags: - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' - - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' - goos: - - windows - goarch: - - amd64 + # - id: signatory-windows-amd + # binary: signatory + # env: + # - CGO_ENABLED=1 + # - CC=x86_64-w64-mingw32-gcc + # - CXX=x86_64-w64-mingw32-g++ + # main: ./cmd/signatory/main.go + # ldflags: + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' + # goos: + # - windows + # goarch: + # - amd64 + # - id: signatory-cli-windows-amd + # binary: signatory-cli + # env: + # - CGO_ENABLED=1 + # - CC=x86_64-w64-mingw32-gcc + # - CXX=x86_64-w64-mingw32-g++ + # main: ./cmd/signatory-cli/main.go + # ldflags: + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}' + # - '-X github.com/ecadlabs/signatory/pkg/metrics.GitBranch={{.Version}}' + # goos: + # - windows + # goarch: + # - amd64 dockers: - ids: - signatory @@ -243,7 +243,7 @@ docker_manifests: checksum: name_template: checksums.txt snapshot: - name_template: '{{ .Version }}-SNAPSHOT-{{.FullCommit}}' + name_template: 'SNAPSHOT-{{.ShortCommit}}' changelog: sort: asc filters: