From c0a3bf2710fb46db01ae4341c8279ca101bd3b33 Mon Sep 17 00:00:00 2001 From: Benjamin Cartier Date: Thu, 30 Jul 2020 15:55:57 -0400 Subject: [PATCH] ci: Adding WASM build --- azure-pipelines.yml | 22 +++++++ build/stage-build-wasm.yml | 35 ++++++++++ build/stage-release-wasm.yml | 20 ++++++ src/library/Uno.Material/Uno.Material.csproj | 2 +- .../Uno.Material.Samples.Droid.csproj | 7 +- .../Uno.Material.Samples.UWP.csproj | 6 +- .../Uno.Material.Samples.Wasm.csproj | 65 ++++++++++--------- .../Uno.Material.Samples.Wasm/Version.txt | 1 + .../Uno.Material.Samples.iOS.csproj | 6 +- .../Uno.Material.Samples.macOS.csproj | 6 +- 10 files changed, 124 insertions(+), 46 deletions(-) create mode 100644 build/stage-build-wasm.yml create mode 100644 build/stage-release-wasm.yml create mode 100644 src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 57a10dc1..b4f0b28e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,7 @@ variables: iOSArtifactName: iOS UWPArtifactName: UWP macOSArtifactName: macOS + WASMArtifactName: WASM # Path where packages (nuget or app packages) will be copied to. PackageOutputPath: $(Build.ArtifactStagingDirectory) @@ -141,6 +142,19 @@ stages: - template: build/stage-build.yml + - job: Build_Wasm + container: unoplatform/wasm-build:2.2 + + pool: + vmImage: 'ubuntu-18.04' + + variables: + NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget + SkipUnknowFrameworks: True + + steps: + - template: build/stage-build-wasm.yml + - stage: Release_Nuget # Only release when the build is not a Pull Request and it's using one of the proper release branches condition: and(succeeded(), ne(variables['IsLightBuild'], 'true'), eq(variables['IsReleaseBranch'], 'true')) @@ -164,3 +178,11 @@ stages: jobs: - template: build/stage-release-testflight.yml + +- stage: Release_WASM + # Only release when the build is not a Pull Request and it's using one of the proper release branches + condition: and(succeeded(), ne(variables['IsLightBuild'], 'true'), eq(variables['IsReleaseBranch'], 'true')) + dependsOn: Build + + jobs: + - template: build/stage-release-wasm.yml \ No newline at end of file diff --git a/build/stage-build-wasm.yml b/build/stage-build-wasm.yml new file mode 100644 index 00000000..60702996 --- /dev/null +++ b/build/stage-build-wasm.yml @@ -0,0 +1,35 @@ + steps: + - bash: | + cd ~ + git clone --branch 1.39.11 https://github.com/emscripten-core/emsdk + cd emsdk + ./emsdk install sdk-1.39.11 + ./emsdk activate sdk-1.39.11 + displayName: 'Setup Emscripten' + + - task: UseGitVersion@5 + inputs: + versionSpec: '5.x' + updateAssemblyInfo: 'False' + + - task: Bash@3 + inputs: + targetType: inline + script: | + source ~/emsdk/emsdk_env.sh + msbuild /r /p:Configuration=Release /p:ApplicationVersion=$(USEGITVERSION.GITVERSION.MAJORMINORPATCH) $(build.sourcesdirectory)/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj + + - task: CopyFiles@2 + displayName: 'Copy version information' + inputs: + Contents: $(build.sourcesdirectory)/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt + TargetFolder: $(build.artifactstagingdirectory) + flattenFolders: true + + - task: PublishBuildArtifacts@1 + # https://developercommunity.visualstudio.com/content/problem/284991/public-vsts-previouw-cant-set-build-number-of-pr-b.html + condition: eq(variables['System.PullRequest.IsFork'], 'False') + inputs: + PathtoPublish: $(build.artifactstagingdirectory) + ArtifactName: $(ArtifactName) + ArtifactType: Container \ No newline at end of file diff --git a/build/stage-release-wasm.yml b/build/stage-release-wasm.yml new file mode 100644 index 00000000..c279839d --- /dev/null +++ b/build/stage-release-wasm.yml @@ -0,0 +1,20 @@ +jobs: +- job: Publish_WASM + pool: + vmImage: windows-2019 + + steps: + - checkout: none + + - task: DownloadBuildArtifacts@0 + inputs: + buildType: current + downloadType: single + artifactName: $(WASMArtifactName) + + - task: nventivecorp.nventive.nventive.websiteVersion.websiteVersion@5 + displayName: 'Deploy Uno Material to Azure' + inputs: + WebsitePath: '$(System.ArtifactsDirectory)/$(WASMArtifactName)' + AzureSubscription: 'Uno Platform' + AzureStorageAccount: unomaterial \ No newline at end of file diff --git a/src/library/Uno.Material/Uno.Material.csproj b/src/library/Uno.Material/Uno.Material.csproj index 73effe94..2dffd1a2 100644 --- a/src/library/Uno.Material/Uno.Material.csproj +++ b/src/library/Uno.Material/Uno.Material.csproj @@ -8,7 +8,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/samples/Uno.Material.Samples/Uno.Material.Samples.Droid/Uno.Material.Samples.Droid.csproj b/src/samples/Uno.Material.Samples/Uno.Material.Samples.Droid/Uno.Material.Samples.Droid.csproj index 5e209bb7..0769e3c8 100644 --- a/src/samples/Uno.Material.Samples/Uno.Material.Samples.Droid/Uno.Material.Samples.Droid.csproj +++ b/src/samples/Uno.Material.Samples/Uno.Material.Samples.Droid/Uno.Material.Samples.Droid.csproj @@ -67,17 +67,17 @@ - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -190,7 +190,6 @@ - diff --git a/src/samples/Uno.Material.Samples/Uno.Material.Samples.UWP/Uno.Material.Samples.UWP.csproj b/src/samples/Uno.Material.Samples/Uno.Material.Samples.UWP/Uno.Material.Samples.UWP.csproj index 6d7ab344..1ff3fb2b 100644 --- a/src/samples/Uno.Material.Samples/Uno.Material.Samples.UWP/Uno.Material.Samples.UWP.csproj +++ b/src/samples/Uno.Material.Samples/Uno.Material.Samples.UWP/Uno.Material.Samples.UWP.csproj @@ -13,17 +13,17 @@ - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj b/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj index 7399df8f..b9314a59 100644 --- a/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj +++ b/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Uno.Material.Samples.Wasm.csproj @@ -3,6 +3,7 @@ Exe netstandard2.0 + True NU1701 @@ -12,7 +13,7 @@ true - + @@ -28,35 +29,35 @@ You can safely remove this ItemGroup completely. --> - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + \ No newline at end of file diff --git a/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt b/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt new file mode 100644 index 00000000..0438e7e0 --- /dev/null +++ b/src/samples/Uno.Material.Samples/Uno.Material.Samples.Wasm/Version.txt @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file diff --git a/src/samples/Uno.Material.Samples/Uno.Material.Samples.iOS/Uno.Material.Samples.iOS.csproj b/src/samples/Uno.Material.Samples/Uno.Material.Samples.iOS/Uno.Material.Samples.iOS.csproj index 3bd6d791..f1e405e6 100644 --- a/src/samples/Uno.Material.Samples/Uno.Material.Samples.iOS/Uno.Material.Samples.iOS.csproj +++ b/src/samples/Uno.Material.Samples/Uno.Material.Samples.iOS/Uno.Material.Samples.iOS.csproj @@ -168,17 +168,17 @@ - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/samples/Uno.Material.Samples/Uno.Material.Samples.macOS/Uno.Material.Samples.macOS.csproj b/src/samples/Uno.Material.Samples/Uno.Material.Samples.macOS/Uno.Material.Samples.macOS.csproj index 1d292a00..e9b7ef8d 100644 --- a/src/samples/Uno.Material.Samples/Uno.Material.Samples.macOS/Uno.Material.Samples.macOS.csproj +++ b/src/samples/Uno.Material.Samples/Uno.Material.Samples.macOS/Uno.Material.Samples.macOS.csproj @@ -70,17 +70,17 @@ - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all - 0.1.0-alpha.55 + 0.1.0-alpha.58 runtime; build; native; contentfiles; analyzers; buildtransitive all