Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL-1310: Add release targets for ODBC on macos #131

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ Check that the released files, library and symbols, are available at the followi
- Release build
- `https://translators-connectors-releases.s3.us-east-1.amazonaws.com/mongosql-odbc-driver/ubuntu2204/${release_version}/release/libatsql.so`
- `https://translators-connectors-releases.s3.us-east-1.amazonaws.com/mongosql-odbc-driver/ubuntu2204/${release_version}/release/mongoodbc.tar.gz`
- Macos
- Release build
- `https://translators-connectors-releases.s3.us-east-1.amazonaws.com/mongosql-odbc-driver/macos/${release_version}/mongoodbc.dmg`
- `https://translators-connectors-releases.s3.us-east-1.amazonaws.com/mongosql-odbc-driver/macos/${release_version}/libatsql.dylib`
- Macos-ARM
- Release build
- `https://translators-connectors-releases.s3.us-east-1.amazonaws.com/mongosql-odbc-driver/macos-arm/${release_version}/mongoodbc.dmg`
- `https://translators-connectors-releases.s3.us-east-1.amazonaws.com/mongosql-odbc-driver/macos-arm/${release_version}/libatsql.dylib`

##### Verify that the driver works with PowerBI
Download and install the driver file.
Expand Down
160 changes: 160 additions & 0 deletions evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ functions:
local_file: mongosql-odbc-driver/installer/tgz/mongoodbc.tar.gz
bucket: mciuploads

"fetch for macos sign":
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/${build_variant}/release/mongoodbc.dmg
local_file: mongosql-odbc-driver/installer/dmg/mongoodbc.dmg
bucket: mciuploads
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/${build_variant}/release/libatsql.dylib
local_file: mongosql-odbc-driver/target/release/libatsql.dylib
bucket: mciuploads

"fetch source":
- command: git.get_project
params:
Expand Down Expand Up @@ -69,11 +85,15 @@ functions:
RELEASE_VERSION: "$RELEASE_VERSION"
WINDOWS_INSTALLER_PATH: "mongosql-odbc-driver/windows/$RELEASE_VERSION/release/mongoodbc.msi"
UBUNTU2204_INSTALLER_PATH: "mongosql-odbc-driver/ubuntu2204/$RELEASE_VERSION/release/mongoodbc.tar.gz"
MACOS_INSTALLER_PATH: "mongosql-odbc-driver/macos/$RELEASE_VERSION/release/mongoodbc.dmg"
MACOS_ARM_INSTALLER_PATH: "mongosql-odbc-driver/macos-arm/$RELEASE_VERSION/release/mongoodbc.dmg"
prepare_shell: |
set -o errexit
export RELEASE_VERSION="$RELEASE_VERSION"
export WINDOWS_INSTALLER_PATH="$WINDOWS_INSTALLER_PATH"
export UBUNTU2204_INSTALLER_PATH="$UBUNTU2204_INSTALLER_PATH"
export MACOS_INSTALLER_PATH="$MACOS_INSTALLER_PATH"
export MACOS_ARM_INSTALLER_PATH="$MACOS_ARM_INSTALLER_PATH"
export PATH="$PATH"
export CARGO_NET_GIT_FETCH_WITH_CLI="$CARGO_NET_GIT_FETCH_WITH_CLI"
git config --global url."ssh://[email protected]/".insteadOf "https://github.com/"
Expand Down Expand Up @@ -237,6 +257,42 @@ functions:
--notary-url "${notary_client_url}" \
mongoodbc.tar.gz

"sign macos":
- command: shell.exec
type: test
params:
shell: bash
working_dir: mongosql-odbc-driver
script: |
${prepare_shell}
curl -LO https://macos-notary-1628249594.s3.amazonaws.com/releases/client/v3.3.3/darwin_amd64.zip
unzip -o darwin_amd64.zip
chmod 0755 ./darwin_amd64/macnotary
./darwin_amd64/macnotary -v
zip macos-mongo-odbc.zip installer/dmg/mongoodbc.dmg target/release/libatsql.dylib
- command: mac.sign
params:
key_id: ${key_id}
secret: ${secret}
service_url: ${service_url}
client_binary: mongosql-odbc-driver/darwin_amd64/macnotary
local_zip_file: mongosql-odbc-driver/macos-mongo-odbc.zip
output_zip_file: mongosql-odbc-driver/macos-mongo-odbc-signed.zip
artifact_type: binary
verify: true
notarize: true
bundle_id: com.mongodb.mongoodbc
- command: shell.exec
type: test
params:
shell: bash
working_dir: mongosql-odbc-driver
script: |
${prepare_shell}
unzip -o macos-mongo-odbc-signed.zip
mv mongoodbc.dmg mongoodbc-signed.dmg
mv libatsql.dylib libatsql-signed.dylib

"compile release":
- command: shell.exec
type: test
Expand Down Expand Up @@ -444,6 +500,7 @@ functions:
params:
build_variants:
- macos
- macos-arm
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongosql-odbc-driver/target/release/libatsql.dylib
Expand All @@ -455,6 +512,7 @@ functions:
params:
build_variants:
- macos
- macos-arm
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongosql-odbc-driver/installer/dmg/mongoodbc.dmg
Expand Down Expand Up @@ -531,6 +589,26 @@ functions:
permissions: public-read
content_type: application/octet-stream

"upload signed macos artifacts":
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/{buildvariant}/release/mongoodbc-signed.dmg
local_file: mongosql-odbc-driver/mongoodbc-signed.dmg
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/{buildvariant}/release/libatsql-signed.dylib
local_file: mongosql-odbc-driver/libatsql-signed.dylib
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream

"upload release":
- command: s3.get
params:
Expand Down Expand Up @@ -650,6 +728,74 @@ functions:
bucket: translators-connectors-releases
permissions: public-read
content_type: application/octet-stream
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/macos/release/libatsql-signed.dylib
local_file: mongosql-odbc-driver/target/release/libatsql-signed.dylib
bucket: mciuploads
- command: s3.put
params:
aws_key: ${release_aws_key}
aws_secret: ${release_aws_secret}
local_file: mongosql-odbc-driver/target/release/libatsql-signed.dylib
remote_file: mongosql-odbc-driver/macos/${RELEASE_VERSION}/libatsql.dylib
bucket: translators-connectors-releases
permissions: public-read
content_type: application/octet-stream
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/macos/release/mongoodbc-signed.dmg
local_file: mongosql-odbc-driver/target/release/mongoodbc-signed.dmg
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
- command: s3.put
params:
aws_key: ${release_aws_key}
aws_secret: ${release_aws_secret}
local_file: mongosql-odbc-driver/target/release/mongoodbc-signed.dmg
remote_file: ${MACOS_INSTALLER_PATH}
bucket: translators-connectors-releases
permissions: public-read
content_type: application/octet-stream
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/macos-arm/release/libatsql-signed.dylib
local_file: mongosql-odbc-driver/target/release/libatsql-signed.dylib
bucket: mciuploads
- command: s3.put
params:
aws_key: ${release_aws_key}
aws_secret: ${release_aws_secret}
local_file: mongosql-odbc-driver/target/release/libatsql-signed.dylib
remote_file: mongosql-odbc-driver/macos-arm/${RELEASE_VERSION}/libatsql.dylib
bucket: translators-connectors-releases
permissions: public-read
content_type: application/octet-stream
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongosql-odbc-driver/artifacts/${version_id}/macos-arm/release/mongoodbc-signed.dmg
local_file: mongosql-odbc-driver/target/release/mongoodbc-signed.dmg
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
- command: s3.put
params:
aws_key: ${release_aws_key}
aws_secret: ${release_aws_secret}
local_file: mongosql-odbc-driver/target/release/mongoodbc-signed.dmg
remote_file: ${MACOS_ARM_INSTALLER_PATH}
bucket: translators-connectors-releases
permissions: public-read
content_type: application/octet-stream

"upload debug":
- command: s3.get
Expand Down Expand Up @@ -1310,6 +1456,8 @@ functions:
sed -i 's@{RELEASE_VERSION}@'${RELEASE_VERSION}'@' mongo-odbc-downloads_template.json
sed -i 's@{WINDOWS_INSTALLER_PATH}@'${WINDOWS_INSTALLER_PATH}'@' mongo-odbc-downloads_template.json
sed -i 's@{UBUNTU2204_INSTALLER_PATH}@'${UBUNTU2204_INSTALLER_PATH}'@' mongo-odbc-downloads_template.json
sed -i 's@{MACOS_INSTALLER_PATH}@'${MACOS_INSTALLER_PATH}'@' mongo-odbc-downloads_template.json
sed -i 's@{MACOS_ARM_INSTALLER_PATH}@'${MACOS_ARM_INSTALLER_PATH}'@' mongo-odbc-downloads_template.json
echo "--------- New release object ----------------"
cat mongo-odbc-downloads_template.json
echo "---------------------------------------------"
Expand Down Expand Up @@ -1459,6 +1607,14 @@ tasks:
- func: "sign ubuntu"
- func: "upload ubuntu sig file"

- name: macos-sign
depends_on:
- name: compile-macos
commands:
- func: "fetch for macos sign"
- func: "sign macos"
- func: "upload signed macos artifacts"

- name: macos-unit-test
commands:
- func: "install iODBC"
Expand Down Expand Up @@ -1640,6 +1796,8 @@ buildvariants:
- name: macos-unit-test
- name: macos-integration-test
- name: macos-result-set-test
- name: macos-sign
run_on: macos-1014-codesign

- name: macos-arm
display_name: "macOS 11.0 ARM 64"
Expand All @@ -1650,6 +1808,8 @@ buildvariants:
- name: macos-unit-test
- name: macos-integration-test
- name: macos-result-set-test
- name: macos-sign
run_on: macos-1014-codesign

- name: release
display_name: "Release"
Expand Down
8 changes: 8 additions & 0 deletions resources/download-center/mongo-odbc-downloads_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
{
"name": "Ubuntu 22.04 (x86_64)",
"download_link": "https://translators-connectors-releases.s3.amazonaws.com/{UBUNTU2204_INSTALLER_PATH}"
},
{
"name": "MacOS",
"download_link": "https://translators-connectors-releases.s3.amazonaws.com/{MACOS_INSTALLER_PATH}"
},
{
"name": "MacOS ARM",
"download_link": "https://translators-connectors-releases.s3.amazonaws.com/{MACOS_ARM_INSTALLER_PATH}"
}
]
}
Expand Down