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

Add Apple Silicon build and Universal build for macOS #20776

Merged
merged 37 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
959a0fc
use stages
alanrenmsft Oct 5, 2022
4ba6e24
fix indention
alanrenmsft Oct 5, 2022
c2c657c
add jobs section
alanrenmsft Oct 5, 2022
3306a2e
fix error
alanrenmsft Oct 5, 2022
c92513d
indention
alanrenmsft Oct 5, 2022
f1137f3
arm64 for macos
alanrenmsft Oct 6, 2022
f994d8b
other stages not run
alanrenmsft Oct 6, 2022
9aa253b
fix container
alanrenmsft Oct 6, 2022
507b8cb
fix
alanrenmsft Oct 6, 2022
9c33d2b
fix stage
alanrenmsft Oct 6, 2022
fd101e9
skip tests
alanrenmsft Oct 6, 2022
0e6d544
variable
alanrenmsft Oct 6, 2022
45e5994
dependency
alanrenmsft Oct 6, 2022
0a87c93
fix name error
alanrenmsft Oct 6, 2022
726cc5c
sts
alanrenmsft Oct 6, 2022
75553b9
const
alanrenmsft Oct 6, 2022
c92e621
fall back to x64
alanrenmsft Oct 7, 2022
a75cedf
pass in variable
alanrenmsft Oct 7, 2022
5974494
universal flavor
alanrenmsft Oct 7, 2022
1334aa9
fix universal
alanrenmsft Oct 7, 2022
13002f3
fix path
alanrenmsft Oct 7, 2022
7b60671
remove
alanrenmsft Oct 7, 2022
a0e3842
special processing
alanrenmsft Oct 8, 2022
0b88d75
return on error
alanrenmsft Oct 8, 2022
06d18c0
copy instead of move
alanrenmsft Oct 8, 2022
42f117f
restore sts
alanrenmsft Oct 8, 2022
1d62c01
release
alanrenmsft Oct 8, 2022
165cfa9
fix error
alanrenmsft Oct 9, 2022
e69a505
Fix readme
alanrenmsft Oct 9, 2022
f721b02
Merge remote-tracking branch 'origin/main' into alanren/use-stages-in…
alanrenmsft Oct 9, 2022
1ea2fee
remove commented code
alanrenmsft Oct 9, 2022
f1dba9b
add comments
alanrenmsft Oct 9, 2022
0e3795f
add issue
alanrenmsft Oct 10, 2022
dfdf2f5
update comment
alanrenmsft Oct 10, 2022
521f60d
pr comments
alanrenmsft Oct 10, 2022
b6916eb
delete universal yml
alanrenmsft Oct 10, 2022
bcd06e8
update the generated js file
alanrenmsft Oct 10, 2022
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Go to our [download page](https://aka.ms/getazuredatastudio) for more specific i
- [Windows User Installer - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/win32-x64-user/insider)
- [Windows System Installer - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/win32-x64/insider)
- [Windows ZIP - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/win32-x64-archive/insider)
- [macOS ZIP - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/darwin/insider)
- [macOS ZIP (Universal) - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/darwin-universal/insider)
- [macOS ZIP (Intel Chip) - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/darwin/insider)
- [macOS ZIP (Apple Silicon) - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/darwin-arm64/insider)
- [Linux TAR.GZ - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/linux-x64/insider)

See the [change log](https://github.com/Microsoft/azuredatastudio/blob/main/CHANGELOG.md) for additional details of what's in this release.
Expand Down
2 changes: 1 addition & 1 deletion build/.cachesalt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021-11-19T02:27:18.022Z
2022-10-06T02:27:18.022Z
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ steps:
displayName: 'Download Build Artifacts'
inputs:
downloadType: specific
itemPattern: 'drop/darwin/archive/azuredatastudio-darwin-unsigned.zip'
itemPattern: 'drop/darwin/archive/azuredatastudio-darwin-$(VSCODE_ARCH)-unsigned.zip'
downloadPath: '$(Build.SourcesDirectory)/.build/'

- script: |
pushd $(Build.SourcesDirectory)/.build/drop/darwin/archive
mv azuredatastudio-darwin-unsigned.zip azuredatastudio-darwin.zip
mv azuredatastudio-darwin-$(VSCODE_ARCH)-unsigned.zip azuredatastudio-darwin-$(VSCODE_ARCH).zip
displayName: 'Rename the file'

- task: UseDotNet@2
Expand All @@ -29,7 +29,7 @@ steps:
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: '$(Build.SourcesDirectory)/.build/drop/darwin/archive'
Pattern: 'azuredatastudio-darwin.zip'
Pattern: 'azuredatastudio-darwin-$(VSCODE_ARCH).zip'
signConfigType: inlineSignParams
inlineOperation: |
[
Expand All @@ -47,7 +47,7 @@ steps:
condition: and(succeeded(), eq(variables['signed'], true))

- script: |
zip -d $(Build.SourcesDirectory)/.build/drop/darwin/archive/azuredatastudio-darwin.zip "*.pkg"
zip -d $(Build.SourcesDirectory)/.build/drop/darwin/archive/azuredatastudio-darwin-$(VSCODE_ARCH).zip "*.pkg"
displayName: Clean Archive
condition: and(succeeded(), eq(variables['signed'], true))

Expand All @@ -56,7 +56,7 @@ steps:
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: '$(Build.SourcesDirectory)/.build/drop/darwin/archive'
Pattern: 'azuredatastudio-darwin.zip'
Pattern: 'azuredatastudio-darwin-$(VSCODE_ARCH).zip'
signConfigType: inlineSignParams
inlineOperation: |
[
Expand Down
39 changes: 29 additions & 10 deletions build/azure-pipelines/darwin/sql-product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ steps:

- script: |
mkdir -p .build
node build/azure-pipelines/common/sql-computeNodeModulesCacheKey.js > .build/yarnlockhash
node build/azure-pipelines/common/sql-computeNodeModulesCacheKey.js $(NPM_CONFIG_ARCH) > .build/yarnlockhash
displayName: Prepare yarn cache key

- task: Cache@2
Expand All @@ -71,6 +71,7 @@ steps:

- script: |
set -e
export npm_config_arch=$(NPM_CONFIG_ARCH)
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
displayName: Install dependencies
env:
Expand Down Expand Up @@ -99,10 +100,11 @@ steps:
- script: |
set -e
yarn gulp package-rebuild-extensions
yarn gulp vscode-darwin-x64-min-ci
yarn gulp vscode-darwin-$(VSCODE_ARCH)-min-ci
displayName: Build
env:
VSCODE_MIXIN_PASSWORD: $(github-distro-mixin-password)
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'universal'))

- script: |
set -e
Expand All @@ -115,7 +117,7 @@ steps:
# including the remote server and configure the integration tests
# to run with these builds instead of running out of sources.
set -e
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin-x64
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin-$(VSCODE_ARCH)
APP_NAME="`ls $APP_ROOT | head -n 1`"
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/azuredatastudio-reh-darwin" \
Expand All @@ -127,12 +129,13 @@ steps:
set -e
yarn gulp compile-extensions
displayName: Compile Extensions
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'universal'))

# Per https://developercommunity.visualstudio.com/t/variablesexpressions-dont-work-with-continueonerro/1187733 we can't use variables
# in continueOnError directly so instead make two copies of the task and only run one or the other based on the SMOKE_FAIL_ON_ERROR value
- script: |
set -e
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin-x64
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin-$(VSCODE_ARCH)
APP_NAME="`ls $APP_ROOT | head -n 1`"
yarn smoketest --build "$APP_ROOT/$APP_NAME" --screenshots "$(build.artifactstagingdirectory)/smokeshots" --log "$(build.artifactstagingdirectory)/logs/darwin/smoke.log" --extensionsDir "$(build.sourcesdirectory)/extensions"
displayName: Run smoke tests (Electron) (Continue on Error)
Expand All @@ -141,7 +144,7 @@ steps:

- script: |
set -e
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin-x64
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin-$(VSCODE_ARCH)
APP_NAME="`ls $APP_ROOT | head -n 1`"
yarn smoketest --build "$APP_ROOT/$APP_NAME" --screenshots "$(build.artifactstagingdirectory)/smokeshots" --log "$(build.artifactstagingdirectory)/logs/darwin/smoke.log" --extensionsDir "$(build.sourcesdirectory)/extensions"
displayName: Run smoke tests (Electron) (Fail on Error)
Expand All @@ -156,9 +159,25 @@ steps:
# continueOnError: true
# condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))

- task: DownloadBuildArtifacts@0
displayName: 'Download arm64 and x64 packages'
inputs:
downloadType: specific
itemPattern: 'drop/darwin/archive/azuredatastudio-darwin-@(arm64|x64)-unsigned.zip'
downloadPath: $(agent.builddirectory)
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'universal'))

- script: |
set -e
unzip $(agent.builddirectory)/drop/darwin/archive/azuredatastudio-darwin-x64-unsigned.zip -d $(agent.builddirectory)/azuredatastudio-darwin-x64
unzip $(agent.builddirectory)/drop/darwin/archive/azuredatastudio-darwin-arm64-unsigned.zip -d $(agent.builddirectory)/azuredatastudio-darwin-arm64
DEBUG=* node build/darwin/create-universal-app.js
displayName: Create Universal App
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'universal'))

- script: |
set -e
pushd ../azuredatastudio-darwin-x64
pushd ../azuredatastudio-darwin-$(VSCODE_ARCH)
ls

echo "Cleaning the application"
Expand Down Expand Up @@ -188,17 +207,17 @@ steps:
- script: |
set -e
mkdir -p .build/darwin/archive
pushd ../azuredatastudio-darwin-x64
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
pushd ../azuredatastudio-darwin-$(VSCODE_ARCH)
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin-$(VSCODE_ARCH).zip
popd
displayName: 'Archive (no signing)'
condition: and(succeeded(), eq(variables['signed'], false))

- script: |
set -e
mkdir -p .build/darwin/archive
pushd ../azuredatastudio-darwin-x64
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin-unsigned.zip
pushd ../azuredatastudio-darwin-$(VSCODE_ARCH)
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin-$(VSCODE_ARCH)-unsigned.zip
popd
displayName: 'Archive'
condition: and(succeeded(), eq(variables['signed'], true))
Expand Down
24 changes: 17 additions & 7 deletions build/azure-pipelines/darwin/sql-publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ $Version = $VersionJson.version
$Quality = $VersionJson.quality
$CommitId = $VersionJson.commit

$ZipName = "azuredatastudio-darwin.zip"
$Zip = "$artifactsDir\darwin\archive\$ZipName"
$UploadName = "azuredatastudio-macos-$Version"
$Flavors = "x64","arm64","universal"
$FlavorSuffixes = "","-arm64","-universal"

If (-NOT ($Quality -eq "stable")) {
$UploadName = "$UploadName-$Quality"
}
For($i = 0; $i -lt $Flavors.Length; $i++)
{
$Flavor = $Flavors[$i]
$FlavorSuffix = $FlavorSuffixes[$i]
$ZipName = "azuredatastudio-darwin-$Flavor.zip"
$Zip = "$artifactsDir\darwin\archive\$ZipName"
$UploadName = "azuredatastudio-macos$FlavorSuffix-$Version"

If (-NOT ($Quality -eq "stable")) {
$UploadName = "$UploadName-$Quality"
}

node $sourcesDir\build\azure-pipelines\common\publish.js $Quality darwin archive "$UploadName.zip" $Version true $Zip $CommitId
$Platform = "darwin$FlavorSuffix"

node $sourcesDir\build\azure-pipelines\common\publish.js $Quality $Platform archive "$UploadName.zip" $Version true $Zip $CommitId
}
Loading