From fcdf297837fc576146125bf06a95ded51d4b21c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Svantesson?= Date: Mon, 20 Jan 2025 17:55:50 +0100 Subject: [PATCH] fix: release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MÃ¥rten Svantesson --- .github/workflows/jenkins-x-pr.yaml | 4 ++-- .github/workflows/jenkins-x-release.yaml | 6 +++--- .github/workflows/jenkins-x/changelog.sh | 3 +-- .../workflows/jenkins-x/upload-binaries.sh | 4 ---- .goreleaser.yml | 20 +++++-------------- 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/jenkins-x-pr.yaml b/.github/workflows/jenkins-x-pr.yaml index efb26b7..7db8c6d 100644 --- a/.github/workflows/jenkins-x-pr.yaml +++ b/.github/workflows/jenkins-x-pr.yaml @@ -7,14 +7,14 @@ jobs: - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} name: build-make-linux - uses: docker://golang:1.22.3 + uses: docker://golang:1.23.3 with: args: -c "make linux" entrypoint: /bin/sh - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} name: build-make-test - uses: docker://golang:1.22.3 + uses: docker://golang:1.23.3 with: args: -c "make test" entrypoint: /bin/sh diff --git a/.github/workflows/jenkins-x-release.yaml b/.github/workflows/jenkins-x-release.yaml index 8a65470..3f7c96c 100644 --- a/.github/workflows/jenkins-x-release.yaml +++ b/.github/workflows/jenkins-x-release.yaml @@ -22,7 +22,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GIT_BOT_TOKEN }} VERSION: ${{ steps.prep.outputs.version }} name: release-binary - uses: docker://golang:1.22.3 + uses: docker://golang:1.23.3 with: args: -c "make release" entrypoint: bash @@ -31,7 +31,7 @@ jobs: REPO_NAME: ${{ github.event.repository.name }} VERSION: ${{ steps.prep.outputs.version }} name: changelog - uses: docker://ghcr.io/jenkins-x/jx-boot:3.10.150 + uses: docker://ghcr.io/jenkins-x/jx-boot:latest with: entrypoint: .github/workflows/jenkins-x/changelog.sh - env: @@ -39,7 +39,7 @@ jobs: REPOSITORY: ${{ github.repository }} VERSION: ${{ steps.prep.outputs.version }} name: upload-binaries - uses: docker://ghcr.io/jenkins-x/jx-goreleaser-image:0.2.2@sha256:77a7c9b281e8dba01f77d0d46c5bd9834a7bd435570f3396a03bfe63554f03f0 + uses: docker://ghcr.io/jenkins-x/jx-goreleaser-image:1.0.0@sha256:35070795367fea9a789c1c3a138b5e32262e4253d38e47406ba9ab7833ff15b2 with: entrypoint: .github/workflows/jenkins-x/upload-binaries.sh - name: Set up QEMU diff --git a/.github/workflows/jenkins-x/changelog.sh b/.github/workflows/jenkins-x/changelog.sh index 0b34791..00e9476 100755 --- a/.github/workflows/jenkins-x/changelog.sh +++ b/.github/workflows/jenkins-x/changelog.sh @@ -15,5 +15,4 @@ fi # See https://github.com/actions/checkout/issues/766 git config --global --add safe.directory "$GITHUB_WORKSPACE" -jx changelog create --verbose --header-file=hack/changelog-header.md --version=$VERSION --rev=$PULL_BASE_SHA --output-markdown=changelog.md --update-release=false - +jx changelog create --verbose --version=$VERSION --rev=$PULL_BASE_SHA --output-markdown=changelog.md diff --git a/.github/workflows/jenkins-x/upload-binaries.sh b/.github/workflows/jenkins-x/upload-binaries.sh index d412558..7eccad6 100755 --- a/.github/workflows/jenkins-x/upload-binaries.sh +++ b/.github/workflows/jenkins-x/upload-binaries.sh @@ -5,8 +5,6 @@ echo current git configuration # See https://github.com/actions/checkout/issues/766 git config --global --add safe.directory "$GITHUB_WORKSPACE" -git config --global --get user.name -git config --global --get user.email echo "setting git user" @@ -15,8 +13,6 @@ git config --global user.email "jenkins-x@googlegroups.com" git add * || true git commit -a -m "chore: release $VERSION" --allow-empty -git tag -fa v$VERSION -m "Release version $VERSION" -git push origin v$VERSION export BRANCH=$(git rev-parse --abbrev-ref HEAD) export BUILDDATE=$(date) diff --git a/.goreleaser.yml b/.goreleaser.yml index 8688b40..c16cfd0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,26 +1,23 @@ +version: 2 env: - GO111MODULE=on - CGO_ENABLED=0 before: hooks: - go mod download - builds: - id: jx-promote # Path to main.go file or main package. # Default is `.`. main: ./cmd/main.go - # Binary name. # Can be a path (e.g. `bin/app`) to wrap the binary in a directory. # Default is the name of the project directory. binary: jx-promote - # Custom ldflags templates. # Default is `-s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`. ldflags: - -X "github.com/jenkins-x-plugins/jx-promote/pkg/version.Version={{.Env.VERSION}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.Version={{.Env.VERSION}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.Revision={{.Env.REV}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.Branch={{.Env.BRANCH}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.BuildDate={{.Env.BUILDDATE}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.GoVersion={{.Env.GOVERSION}}" - # GOOS list to build for. # For more info refer to: https://golang.org/doc/install/source#environment # Defaults are darwin and linux. @@ -28,48 +25,41 @@ builds: - windows - darwin - linux - # GOARCH to build for. # For more info refer to: https://golang.org/doc/install/source#environment # Defaults are 386 and amd64. goarch: - arm64 - amd64 - + ignore: + - goos: windows + goarch: arm64 archives: - name_template: "jx-promote-{{ .Os }}-{{ .Arch }}" format_overrides: - goos: windows format: zip - checksum: # You can change the name of the checksums file. # Default is `jx-promote_{{ .Version }}_checksums.txt`. name_template: "jx-promote-checksums.txt" - # Algorithm to be used. # Accepted options are sha256, sha512, sha1, crc32, md5, sha224 and sha384. # Default is sha256. algorithm: sha256 - changelog: - # set it to true if you wish to skip the changelog generation - skip: true - + disable: true release: # If set to true, will not auto-publish the release. # Default is false. draft: false - # If set to auto, will mark the release as not ready for production # in case there is an indicator for this in the tag e.g. v1.0.0-rc1 # If set to true, will mark the release as not ready for production. # Default is false. prerelease: false - # You can change the name of the GitHub release. # Default is `{{.Tag}}` name_template: "{{.Env.VERSION}}" - sboms: - artifacts: archive