From 4b4df9f4dc8570569a55e1946e09de3c48672faa Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Tue, 22 Mar 2022 21:28:36 -0400 Subject: [PATCH 01/13] initial support for m1 --- src/osx/Installer.Mac/distribution.xml | 2 +- src/osx/Installer.Mac/layout.sh | 2 +- .../Atlassian.Bitbucket.UI.Avalonia.csproj | 2 +- src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj | 2 +- src/shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj | 2 +- src/shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osx/Installer.Mac/distribution.xml b/src/osx/Installer.Mac/distribution.xml index 657397513..667286e5d 100644 --- a/src/osx/Installer.Mac/distribution.xml +++ b/src/osx/Installer.Mac/distribution.xml @@ -2,7 +2,7 @@ Git Credential Manager - + diff --git a/src/osx/Installer.Mac/layout.sh b/src/osx/Installer.Mac/layout.sh index 288216165..b372f2ca1 100755 --- a/src/osx/Installer.Mac/layout.sh +++ b/src/osx/Installer.Mac/layout.sh @@ -27,7 +27,7 @@ GITLAB_UI_SRC="$SRC/shared/GitLab.UI.Avalonia" # Build parameters FRAMEWORK=net6.0 -RUNTIME=osx-x64 +RUNTIME=osx-arm64 # Parse script arguments for i in "$@" diff --git a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj b/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj index e1ae6d4af..a9185278a 100644 --- a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj +++ b/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj @@ -3,7 +3,7 @@ WinExe net6.0 - osx-x64;linux-x64 + osx-x64;linux-x64;osx-arm64 Atlassian.Bitbucket.UI Atlassian.Bitbucket.UI diff --git a/src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj b/src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj index 10f598f61..441ee82bc 100644 --- a/src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj +++ b/src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj @@ -4,7 +4,7 @@ Exe net6.0 net472;net6.0 - win-x86;osx-x64;linux-x64 + win-x86;osx-x64;linux-x64;osx-arm64 x86 git-credential-manager-core GitCredentialManager diff --git a/src/shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj b/src/shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj index d1e040118..828677fcc 100644 --- a/src/shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj +++ b/src/shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj @@ -3,7 +3,7 @@ WinExe net6.0 - osx-x64;linux-x64 + osx-x64;linux-x64;osx-arm64 GitHub.UI GitHub.UI diff --git a/src/shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj b/src/shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj index 0a64307ee..26927c272 100644 --- a/src/shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj +++ b/src/shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj @@ -3,7 +3,7 @@ WinExe net6.0 - osx-x64;linux-x64 + osx-x64;linux-x64;osx-arm64 GitLab.UI GitLab.UI From 9d5f189494bfe781ef161c7096055397b913996a Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Tue, 22 Mar 2022 21:42:31 -0400 Subject: [PATCH 02/13] Update Avalonia to latest version --- src/shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj b/src/shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj index 766c921af..a7ade3aaa 100644 --- a/src/shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj +++ b/src/shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj @@ -11,9 +11,9 @@ - - - + + + From 1847b2519f6d8712543d4720a0e25aada2135af4 Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Tue, 22 Mar 2022 22:52:55 -0400 Subject: [PATCH 03/13] Build arm64 or x64 based on arch --- src/osx/Installer.Mac/layout.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/osx/Installer.Mac/layout.sh b/src/osx/Installer.Mac/layout.sh index b372f2ca1..fac180c32 100755 --- a/src/osx/Installer.Mac/layout.sh +++ b/src/osx/Installer.Mac/layout.sh @@ -27,7 +27,21 @@ GITLAB_UI_SRC="$SRC/shared/GitLab.UI.Avalonia" # Build parameters FRAMEWORK=net6.0 -RUNTIME=osx-arm64 + +TEST_ARCH=`uname -m` +case $TEST_ARCH in + "x86_64") + RUNTIME="osx-x64" + ;; + "arm64") + RUNTIME="osx-arm64" + ;; + *) + die "Unknown architecture '$TEST_ARCH'" + ;; +esac + +echo "Building for architecture '$RUNTIME'" # Parse script arguments for i in "$@" From d3cd32d2ab94d4438082045f5df804d4b9ee0f85 Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Tue, 22 Mar 2022 23:05:22 -0400 Subject: [PATCH 04/13] architecture -> runtime --- src/osx/Installer.Mac/layout.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/Installer.Mac/layout.sh b/src/osx/Installer.Mac/layout.sh index fac180c32..871f3b7d1 100755 --- a/src/osx/Installer.Mac/layout.sh +++ b/src/osx/Installer.Mac/layout.sh @@ -41,7 +41,7 @@ case $TEST_ARCH in ;; esac -echo "Building for architecture '$RUNTIME'" +echo "Building for runtime '$RUNTIME'" # Parse script arguments for i in "$@" From ce3a69913cf207af4eabf926f3f23236422b06bd Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Mon, 28 Mar 2022 21:20:22 -0400 Subject: [PATCH 05/13] Add a command line option for runtime --- src/osx/Installer.Mac/layout.sh | 37 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/osx/Installer.Mac/layout.sh b/src/osx/Installer.Mac/layout.sh index 871f3b7d1..b7be0010f 100755 --- a/src/osx/Installer.Mac/layout.sh +++ b/src/osx/Installer.Mac/layout.sh @@ -28,21 +28,6 @@ GITLAB_UI_SRC="$SRC/shared/GitLab.UI.Avalonia" # Build parameters FRAMEWORK=net6.0 -TEST_ARCH=`uname -m` -case $TEST_ARCH in - "x86_64") - RUNTIME="osx-x64" - ;; - "arm64") - RUNTIME="osx-arm64" - ;; - *) - die "Unknown architecture '$TEST_ARCH'" - ;; -esac - -echo "Building for runtime '$RUNTIME'" - # Parse script arguments for i in "$@" do @@ -55,6 +40,10 @@ case "$i" in PAYLOAD="${i#*=}" shift # past argument=value ;; + --runtime=*) + RUNTIME="${i#*=}" + shift # past argument=value + ;; --symbol-output=*) SYMBOLOUT="${i#*=}" ;; @@ -64,6 +53,24 @@ case "$i" in esac done +# Determine a runtime if one was not provided +if [ -z "$RUNTIME" ]; then + TEST_ARCH=`uname -m` + case $TEST_ARCH in + "x86_64") + RUNTIME="osx-x64" + ;; + "arm64") + RUNTIME="osx-arm64" + ;; + *) + die "Unknown architecture '$TEST_ARCH'" + ;; + esac +fi + +echo "Building for runtime '$RUNTIME'" + # Perform pre-execution checks CONFIGURATION="${CONFIGURATION:=Debug}" if [ -z "$PAYLOAD" ]; then From f8e1cd2823a84537727b02fb2ac93116ddb08d41 Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Mon, 28 Mar 2022 21:24:41 -0400 Subject: [PATCH 06/13] Add runtime option to build script I'm having a serious case of the Mondays... --- src/osx/Installer.Mac/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osx/Installer.Mac/build.sh b/src/osx/Installer.Mac/build.sh index 816c621ec..f8aaf2260 100755 --- a/src/osx/Installer.Mac/build.sh +++ b/src/osx/Installer.Mac/build.sh @@ -22,6 +22,10 @@ case "$i" in CONFIGURATION="${i#*=}" shift # past argument=value ;; + --runtime=*) + RUNTIME="${i#*=}" + shift + ;; --version=*) VERSION="${i#*=}" shift # past argument=value @@ -45,7 +49,7 @@ COMPONENTOUT="$COMPONENTDIR/com.microsoft.gitcredentialmanager.component.pkg" DISTOUT="$OUTDIR/gcm-osx-x64-$VERSION.pkg" # Layout and pack -"$INSTALLER_SRC/layout.sh" --configuration="$CONFIGURATION" --output="$PAYLOAD" || exit 1 +"$INSTALLER_SRC/layout.sh" --configuration="$CONFIGURATION" --output="$PAYLOAD" --runtime="$RUNTIME" || exit 1 "$INSTALLER_SRC/pack.sh" --payload="$PAYLOAD" --version="$VERSION" --output="$COMPONENTOUT" || exit 1 "$INSTALLER_SRC/dist.sh" --package-path="$COMPONENTDIR" --version="$VERSION" --output="$DISTOUT" || exit 1 From 3afc7a7537ee76a78d5031f3df3a558736f96252 Mon Sep 17 00:00:00 2001 From: buchwasa <17461354+buchwasa@users.noreply.github.com> Date: Sat, 9 Apr 2022 22:22:35 -0400 Subject: [PATCH 07/13] Start passing runtime for compiling through azure pipelines --- src/osx/Installer.Mac/Installer.Mac.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osx/Installer.Mac/Installer.Mac.csproj b/src/osx/Installer.Mac/Installer.Mac.csproj index 685862ff5..f42bd3333 100644 --- a/src/osx/Installer.Mac/Installer.Mac.csproj +++ b/src/osx/Installer.Mac/Installer.Mac.csproj @@ -21,8 +21,8 @@ - - + + From 1efb57f3e7c335bffc1ab40bc005781d345ddcd0 Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Thu, 14 Apr 2022 09:34:36 -0700 Subject: [PATCH 08/13] dependencies: update Microsoft.NET.Test.Sdk to 17.1.0 The specification of a macOS runtime led to the need to update the Microsoft.NET.Test.Sdk package. The old version, when combined with this specificationi, caused dependent packages to be downgraded, which resulted in NuGet errors. Upgrading to the latest version resolved this issue. --- .../Atlassian.Bitbucket.Tests/Atlassian.Bitbucket.Tests.csproj | 2 +- src/shared/Core.Tests/Core.Tests.csproj | 2 +- src/shared/GitHub.Tests/GitHub.Tests.csproj | 2 +- src/shared/GitLab.Tests/GitLab.Tests.csproj | 2 +- .../Microsoft.AzureRepos.Tests.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/Atlassian.Bitbucket.Tests/Atlassian.Bitbucket.Tests.csproj b/src/shared/Atlassian.Bitbucket.Tests/Atlassian.Bitbucket.Tests.csproj index 61f8f2ae5..18d7f90d7 100644 --- a/src/shared/Atlassian.Bitbucket.Tests/Atlassian.Bitbucket.Tests.csproj +++ b/src/shared/Atlassian.Bitbucket.Tests/Atlassian.Bitbucket.Tests.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/shared/Core.Tests/Core.Tests.csproj b/src/shared/Core.Tests/Core.Tests.csproj index 6028211f9..0bc07acd2 100644 --- a/src/shared/Core.Tests/Core.Tests.csproj +++ b/src/shared/Core.Tests/Core.Tests.csproj @@ -13,7 +13,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/shared/GitHub.Tests/GitHub.Tests.csproj b/src/shared/GitHub.Tests/GitHub.Tests.csproj index 3caa998ed..13408d24f 100644 --- a/src/shared/GitHub.Tests/GitHub.Tests.csproj +++ b/src/shared/GitHub.Tests/GitHub.Tests.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/shared/GitLab.Tests/GitLab.Tests.csproj b/src/shared/GitLab.Tests/GitLab.Tests.csproj index 341b7bc51..3212501c7 100644 --- a/src/shared/GitLab.Tests/GitLab.Tests.csproj +++ b/src/shared/GitLab.Tests/GitLab.Tests.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/shared/Microsoft.AzureRepos.Tests/Microsoft.AzureRepos.Tests.csproj b/src/shared/Microsoft.AzureRepos.Tests/Microsoft.AzureRepos.Tests.csproj index cb620ba3b..f10e3ddda 100644 --- a/src/shared/Microsoft.AzureRepos.Tests/Microsoft.AzureRepos.Tests.csproj +++ b/src/shared/Microsoft.AzureRepos.Tests/Microsoft.AzureRepos.Tests.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + From b306d1fcb6685a9479393cd40626ab7255b4dff2 Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Wed, 1 Jun 2022 22:00:28 -0700 Subject: [PATCH 09/13] fixup! macOS release: build, lay out, and codesign payload --- .github/workflows/release.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e15d88394..d1e9711b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,9 @@ jobs: osx-build: name: Build macOS runs-on: macos-latest + strategy: + matrix: + runtime: [ osx-x64, osx-arm64 ] steps: - uses: actions/checkout@v3 with: @@ -27,7 +30,9 @@ jobs: - name: Build run: | - dotnet build --configuration=MacRelease + dotnet build src/osx/Installer.Mac/*.csproj \ + --configuration=MacRelease --no-self-contained \ + --runtime=${{ matrix.runtime }} - name: Run macOS unit tests run: | @@ -35,7 +40,9 @@ jobs: - name: Lay out payload and symbols run: | - src/osx/Installer.Mac/layout.sh --configuration=MacRelease --output=payload --symbol-output=symbols + src/osx/Installer.Mac/layout.sh \ + --configuration=MacRelease --output=payload \ + --symbol-output=symbols --runtime=${{ matrix.runtime }} - name: Create keychain env: @@ -58,7 +65,7 @@ jobs: - name: Upload macOS artifacts uses: actions/upload-artifact@v3 with: - name: tmp.osx-build + name: tmp.${{ matrix.runtime }}-build path: | payload symbols From 71de9ab79f605284077ff812c7c6b4097ed2f3be Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Wed, 1 Jun 2022 22:01:08 -0700 Subject: [PATCH 10/13] fixup! macOS release: sign payload --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1e9711b3..96a233054 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,6 +74,9 @@ jobs: name: Sign macOS payload # ESRP service requires signing to run on Windows runs-on: windows-latest + strategy: + matrix: + runtime: [ osx-x64, osx-arm64 ] needs: osx-build steps: - name: Check out repository @@ -82,7 +85,7 @@ jobs: - name: Download payload uses: actions/download-artifact@v3 with: - name: tmp.osx-build + name: tmp.${{ matrix.runtime }}-build - name: Zip unsigned payload shell: pwsh @@ -116,7 +119,9 @@ jobs: APPLE_KEY_CODE: ${{ secrets.APPLE_KEY_CODE }} APPLE_SIGNING_OP_CODE: ${{ secrets.APPLE_SIGNING_OPERATION_CODE }} run: | - python .github\run_esrp_signing.py payload $env:APPLE_KEY_CODE $env:APPLE_SIGNING_OP_CODE --params 'Hardening' '--options=runtime' + python .github\run_esrp_signing.py payload ` + $env:APPLE_KEY_CODE $env:APPLE_SIGNING_OP_CODE ` + --params 'Hardening' '--options=runtime' - name: Unzip signed payload shell: pwsh @@ -127,7 +132,7 @@ jobs: - name: Upload signed payload uses: actions/upload-artifact@v3 with: - name: osx-payload-sign + name: ${{ matrix.runtime }}-payload-sign path: | signed From b2c5c45b595ae7168c832cd396a5c816c50c77aa Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Wed, 1 Jun 2022 22:02:00 -0700 Subject: [PATCH 11/13] fixup! macOS release: package payload --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96a233054..30aa9708b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -139,6 +139,9 @@ jobs: osx-pack: name: Package macOS payload runs-on: macos-latest + strategy: + matrix: + runtime: [ osx-x64, osx-arm64 ] needs: osx-payload-sign steps: - name: Check out repository @@ -159,20 +162,24 @@ jobs: - name: Download signed payload uses: actions/download-artifact@v3 with: - name: osx-payload-sign + name: ${{ matrix.runtime }}-payload-sign - name: Create component package run: | - src/osx/Installer.Mac/pack.sh --payload=payload --version=$GitBuildVersionSimple --output=components/com.microsoft.gitcredentialmanager.component.pkg + src/osx/Installer.Mac/pack.sh --payload=payload \ + --version=$GitBuildVersionSimple \ + --output=components/com.microsoft.gitcredentialmanager.component.pkg - name: Create product archive run: | - src/osx/Installer.Mac/dist.sh --package-path=components --version=$GitBuildVersionSimple --output=pkg/gcm-osx-x64-$GitBuildVersionSimple.pkg || exit 1 + src/osx/Installer.Mac/dist.sh --package-path=components \ + --version=$GitBuildVersionSimple --runtime=${{ matrix.runtime }} \ + --output=pkg/gcm-${{ matrix.runtime }}-$GitBuildVersionSimple.pkg || exit 1 - name: Upload package uses: actions/upload-artifact@v3 with: - name: tmp.osx-pack + name: tmp.${{ matrix.runtime }}-pack path: | pkg From 3b57816fe28256bff827e54cf1e7ae18acad6f9e Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Wed, 1 Jun 2022 22:02:56 -0700 Subject: [PATCH 12/13] fixup! macOS release: sign and notarize package --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30aa9708b..1b374afd6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -187,6 +187,9 @@ jobs: name: Sign and notarize macOS package # ESRP service requires signing to run on Windows runs-on: windows-latest + strategy: + matrix: + runtime: [ osx-x64, osx-arm64 ] needs: osx-pack steps: - name: Check out repository @@ -195,7 +198,7 @@ jobs: - name: Download unsigned package uses: actions/download-artifact@v3 with: - name: tmp.osx-pack + name: tmp.${{ matrix.runtime }}-pack path: pkg - name: Zip unsigned package @@ -255,7 +258,7 @@ jobs: - name: Publish signed package uses: actions/upload-artifact@v3 with: - name: osx-sign + name: ${{ matrix.runtime }}-sign path: signed/*.pkg # ================================ From a76f5d5ca0a34e37021d39ea97e2287824fe5010 Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Wed, 1 Jun 2022 22:03:52 -0700 Subject: [PATCH 13/13] fixup! release: publish draft release to GitHub --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b374afd6..db6dc6807 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -490,8 +490,12 @@ jobs: - name: Archive macOS payload and symbols run: | mkdir osx-payload-and-symbols - tar -C osx-payload-sign -czf osx-payload-and-symbols/gcm-osx-x64-$GitBuildVersionSimple.tar.gz . - tar -C tmp.osx-build/symbols -czf osx-payload-and-symbols/gcm-osx-x64-$GitBuildVersionSimple-symbols.tar.gz . + + tar -C osx-x64-payload-sign -czf osx-payload-and-symbols/gcm-osx-x64-$GitBuildVersionSimple.tar.gz . + tar -C tmp.osx-x64-build/symbols -czf osx-payload-and-symbols/gcm-osx-x64-$GitBuildVersionSimple-symbols.tar.gz . + + tar -C osx-arm64-payload-sign -czf osx-payload-and-symbols/gcm-osx-arm64-$GitBuildVersionSimple.tar.gz . + tar -C tmp.osx-arm64-build/symbols -czf osx-payload-and-symbols/gcm-osx-arm64-$GitBuildVersionSimple-symbols.tar.gz . - name: Archive Windows payload and symbols shell: pwsh @@ -549,7 +553,8 @@ jobs: uploadDirectoryToRelease('win-x86-payload-and-symbols'), // Upload macOS artifacts - uploadDirectoryToRelease('osx-sign'), + uploadDirectoryToRelease('osx-x64-sign'), + uploadDirectoryToRelease('osx-arm64-sign'), uploadDirectoryToRelease('osx-payload-and-symbols'), // Upload Linux artifacts