Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Daily snapshots

We generate a snapshot build via the `goreleaser_snaphot` and `go_msi_snapshot` evergreen tasks,
these tasks run on master and can be patched at any time.
We generate a snapshot build via the `goreleaser_snaphot` evergreen task,
this task runs on master and can be patched at any time.

- **goreleaser_snaphot:** used with `goreleaser` to generate linux, mac and windows builds, the mac build will also be signed and notarized
- **go_msi_snapshot:** used with `go-msi` to generate a Windows msi installer
- **goreleaser_snaphot:** used with `goreleaser` to generate linux, mac and windows builds, the mac build will also be signed and notarized, and the windows msi is generated on a Windows host spawned via evergreen's `host.create`

## Stable release

Expand Down
117 changes: 14 additions & 103 deletions build/ci/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ variables:
go_root: "/opt/golang/go1.26"
go_bin: "/opt/golang/go1.26/bin"
go_base_path: ""
- &go_windows_version
go_root: "c:\\golang\\go1.26"
go_bin: "c:\\golang\\go1.26/bin"
go_base_path: "c:"
- &go_env
XDG_CONFIG_HOME: ${go_base_path}${workdir}
GO111MODULE: "on"
Expand Down Expand Up @@ -91,6 +87,7 @@ functions:
<<: *go_env
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
AUTHENTICODE_KEY_NAME: ${authenticode_key_name}
include_expansions_in_env:
- go_base_path
- workdir
Expand All @@ -107,36 +104,22 @@ functions:
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
binary: build/package/package.sh
"install go-msi":
- command: subprocess.exec
type: setup
"create-windows-host":
- command: host.create
params:
working_dir: src/github.com/mongodb/mongodb-cli
command: choco install -y "go-msi" --force
"uninstall go-msi":
- command: subprocess.exec
type: setup
distro: windows-vsCurrent-small
- command: host.list
params:
working_dir: src/github.com/mongodb/mongodb-cli
command: choco uninstall -y "go-msi"
"generate msi":
- command: subprocess.exec
type: test
wait: true
num_hosts: 1
path: ${workdir}/src/github.com/mongodb/mongodb-cli/build/ci/hosts.json
- command: shell.exec
params:
<<: *go_options
add_to_path:
- ${go_bin}
- ${go_base_path}${workdir}/bin
- ${go_base_path}${workdir}/src/github.com/mongodb/mongodb-cli/bin
- "/cygdrive/c/Program Files/go-msi"
- "/cygdrive/c/wixtools/bin"
env:
<<: *go_env
SECRET_API_KEY: ${chocolatey_api_key}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
unstable: ${unstable}
command: bash.exe -c build/package/generate-msi.sh
script: |
set -Eeou pipefail
echo "${__project_aws_ssh_key_value}" > ./build/ci/ssh_id
chmod 0600 ./build/ci/ssh_id
"rename pkg":
- command: subprocess.exec
type: test
Expand Down Expand Up @@ -247,66 +230,18 @@ functions:
working_dir: src/github.com/mongodb/mongodb-cli/build/package/docker/repo
binary: ./docker-build.sh
tasks:
- name: package_msi
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "install go-msi"
- func: "generate msi"
vars:
unstable: ${unstable}
- func: "uninstall go-msi"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongodb-cli/bin/*.exe
- src/github.com/mongodb/mongodb-cli/dist/*.msi
remote_file: ${project}/dist/${revision}_${created_at}/unsigned_
bucket: mongodb-mongocli-build
permissions: public-read
content_type: ${content_type|application/octet-stream}
display_name: unsigned
- name: package_goreleaser
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "create-windows-host"
- func: "generate notices"
- func: "install goreleaser"
- func: "install macos notarization service"
- func: "install gh-token"
- func: "authenticate to ecr"
- command: subprocess.exec
type: test
params:
working_dir: src/github.com/mongodb/mongodb-cli
include_expansions_in_env:
- project
- revision
- created_at
env:
BUCKET: mongodb-mongocli-build
unstable: ${unstable}
binary: build/package/download-win-binaries.sh
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- unstable
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
env:
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
AUTHENTICODE_KEY_NAME: ${authenticode_key_name}
working_dir: src/github.com/mongodb/mongodb-cli
binary: build/package/windows_notarize.sh
- func: "package"
vars:
unstable: ${unstable}
Expand Down Expand Up @@ -402,15 +337,6 @@ tasks:
vars:
task_type: repo
buildvariants:
- name: go_mongocli_msi_snapshot
display_name: "Packaging MongoCLI (go-msi)"
run_on:
- windows-vsCurrent-small
expansions:
<<: *go_windows_version
unstable: -unstable
tasks:
- name: package_msi
- name: goreleaser_mongocli_snapshot
display_name: "Packaging MongoCLI (goreleaser)"
run_on:
Expand All @@ -426,9 +352,6 @@ buildvariants:
unstable: -unstable
tasks:
- name: package_goreleaser
depends_on:
- name: package_msi
variant: "go_mongocli_msi_snapshot"
- name: publish_mongocli_snapshot
display_name: "Publish MongoCLI Snapshot"
run_on:
Expand All @@ -438,15 +361,6 @@ buildvariants:
server_version: "4.4.0-rc3"
tasks:
- name: push_mongocli_generate
- name: release_mongocli_msi
display_name: "Release MongoCLI (go-msi)"
run_on:
- windows-vsCurrent-small
git_tag_only: true
expansions:
<<: *go_windows_version
tasks:
- name: package_msi
- name: release_mongocli_github
display_name: "Release MongoCLI (goreleaser)"
run_on:
Expand All @@ -460,9 +374,6 @@ buildvariants:
package_name: "mongocli"
tasks:
- name: package_goreleaser
depends_on:
- name: package_msi
variant: release_mongocli_msi
- name: release_mongocli_publish
display_name: "Publish MongoCLI Generator"
run_on:
Expand Down
9 changes: 6 additions & 3 deletions build/package/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ builds:
- cmd: ./build/package/mac_notarize.sh
output: true
- <<: *build_defaults
builder: prebuilt
id: windows
goos: [windows]
goarch: [amd64]
goamd64: [v1]
prebuilt:
path: ./bin/mongocli.exe
hooks:
post:
- cmd: ./build/package/windows_notarize.sh
output: true
- cmd: ./build/package/windows_build_msi.sh
output: true
gomod: # https://goreleaser.com/customization/verifiable_builds/
# Proxy a module from proxy.golang.org, making the builds verifiable.
# This will only be effective if running against a tag. Snapshots will ignore
Expand Down
40 changes: 0 additions & 40 deletions build/package/download-win-binaries.sh

This file was deleted.

42 changes: 0 additions & 42 deletions build/package/generate-msi.sh

This file was deleted.

31 changes: 31 additions & 0 deletions build/package/msi/generate-msi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Copyright 2020 MongoDB Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -Eeou pipefail

GOROOT="$(cygpath --unix "c:\\golang\\go1.24")"
PATH="${PATH}:$(cygpath --unix "c:\\golang\\go1.24\\bin"):$(cygpath --unix "c:\\Program Files\\go-msi"):$(cygpath --unix "c:\\wixtools\\bin")"
GOCACHE="$(cygpath --unix "c:\\Users\\Administrator\\.cache")"
CGO_ENABLED=0

export GOROOT PATH GOCACHE CGO_ENABLED

choco install -y "go-msi" --force

go-msi make --path "wix.json" --msi "out.msi" --version "$(cat version.txt)"

choco uninstall -y "go-msi" --force

rm -rf "$GOCACHE"
File renamed without changes.
Loading
Loading