diff --git a/.evergreen.yml b/.evergreen.yml index ec7bd77..31c022d 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -1,5 +1,8 @@ variables: - + - &go_env + XDG_CONFIG_HOME: ${go_base_path}${workdir} + GO111MODULE: "on" + GOROOT: "/opt/golang/go1.21" functions: "clone": @@ -42,24 +45,27 @@ functions: type: setup params: working_dir: src/github.com/mongodb/mongodb-enterprise-kubernetes/tools/multicluster - add_to_path: - - src/github.com/mongodb/tools - - src/github.com/mongodb/tools/linux_amd64 include_expansions_in_env: - GITHUB_TOKEN - macos_notary_keyid - macos_notary_secret - workdir + - triggered_by_git_tag env: + <<: *go_env MACOS_NOTARY_KEY: ${macos_notary_keyid} MACOS_NOTARY_SECRET: ${macos_notary_secret} + GORELEASER_CURRENT_TAG: ${triggered_by_git_tag} + # shell.exec EVG Task doesn't have add_to_path, so we need to explicitly add the path export below. script: | set -Eeu pipefail - - ${workdir}/goreleaser release + + export PATH=$GOROOT/bin:$PATH + ${workdir}/goreleaser release --rm-dist tasks: - name: package_goreleaser + git_tag_only: true tags: ["packaging"] commands: - func: "clone" diff --git a/.github/workflows/release-multicluster-cli.yaml b/.github/workflows/release-multicluster-cli.yaml deleted file mode 100644 index 2ce1684..0000000 --- a/.github/workflows/release-multicluster-cli.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release multicluster-cli binary -on: - push: - tags: - - '*' - workflow_dispatch: -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - with: - distribution: goreleaser - version: latest - args: release --rm-dist - workdir: ./tools/multicluster - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GORELEASER_CURRENT_TAG: ${{ github.ref_name }} diff --git a/tools/multicluster/kubectl_mac_notarize.sh b/tools/multicluster/kubectl_mac_notarize.sh index 5208ba8..ca5c89f 100755 --- a/tools/multicluster/kubectl_mac_notarize.sh +++ b/tools/multicluster/kubectl_mac_notarize.sh @@ -20,7 +20,7 @@ set -Eeou pipefail # This depends on binaries being generated in a goreleaser manner and gon being set up. # goreleaser should already take care of calling this script as a hook. -if [[ -f "./dist/kubectl-mongodb_darwin_arm64/kubectl-mongodb" && -f "./dist/kubectl-mongodb_darwin_amd64_v1/kubectl-mongodb" && ! -f "./dist/kubectl-mongodb_macos_signed.zip" ]]; then +if [[ -f "./dist/kubectl-mongodb_darwin_amd64_v1/kubectl-mongodb" && -f "./dist/kubectl-mongodb_darwin_arm64/kubectl-mongodb" && ! -f "./dist/kubectl-mongodb_macos_signed.zip" ]]; then echo "notarizing macOs binaries" zip -r ./dist/kubectl-mongodb_amd64_arm64_bin.zip ./dist/kubectl-mongodb_darwin_amd64_v1/kubectl-mongodb ./dist/kubectl-mongodb_darwin_arm64/kubectl-mongodb # The Notarization Service takes an archive as input "${workdir:-.}"/linux_amd64/macnotary \ @@ -30,6 +30,6 @@ if [[ -f "./dist/kubectl-mongodb_darwin_arm64/kubectl-mongodb" && -f "./dist/kub -o ./dist/kubectl-mongodb_macos_signed.zip echo "replacing original files" - unzip -oj ./dist/kubectl-mongodb_macos_signed.zip dist/macos_darwin_amd64_v1/kubectl-mongodb -d ./dist/macos_darwin_amd64_v1/ - unzip -oj ./dist/kubectl-mongodb_macos_signed.zip dist/macos_darwin_arm64/kubectl-mongodb -d ./dist/macos_darwin_arm64/ + unzip -oj ./dist/kubectl-mongodb_macos_signed.zip dist/kubectl-mongodb_darwin_amd64_v1/kubectl-mongodb -d ./dist/kubectl-mongodb_darwin_amd64_v1/ + unzip -oj ./dist/kubectl-mongodb_macos_signed.zip dist/kubectl-mongodb_darwin_arm64/kubectl-mongodb -d ./dist/kubectl-mongodb_darwin_arm64/ fi \ No newline at end of file