Skip to content

Commit

Permalink
Testing new macos lane (#3953)
Browse files Browse the repository at this point in the history
* Testing new macos lane

* Use publish mono workflow for mono-samples

* Clarify parameter name

* Skip build for mono projects

* Remove .NET 6 Preview install from build validation

* Fix iOS sample package version

Co-authored-by: Mitchell Hwang <[email protected]>
  • Loading branch information
mdh1418 and Mitchell Hwang authored Nov 20, 2020
1 parent 7afb1cd commit 7ae0606
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ jobs:
Invoke-WebRequest https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1 -OutFile dotnet-install.ps1
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
.\dotnet-install.ps1 -InstallDir "c:\program files\dotnet" -Channel "${{ env.DOTNET_INSTALLER_CHANNEL }}"
- name: Setup .NET SDK 6 Preview
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
run: |
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
.\dotnet-install.ps1 -InstallDir "c:\program files\dotnet" -Version 6.0.100-alpha.1.20529.2
# Install locate projs global tool
- name: Install LocateProjects tool
Expand All @@ -75,6 +70,3 @@ jobs:
- name: Report status
run: |
./.github/workflows/dependencies/Out-GithubActionStatus.ps1
9 changes: 7 additions & 2 deletions .github/workflows/dependencies/Get-MSBuildResults.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,16 @@ foreach ($item in $workingSet) {

$data = $item.Split('|')

if ($data[1].Contains("mono-samples")){
Write-Host "Found mono-sample project, Skipping."
$counter++
Continue
}
# Project found, build it
if ([int]$data[0] -eq 0) {
elseif ([int]$data[0] -eq 0) {
$projectFile = Resolve-Path "$RepoRootDir\$($data[2])"
$configFile = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($projectFile), "snippets.5000.json")

# Create the default build command
"dotnet build `"$projectFile`"" | Out-File ".\run.bat"

Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/publish-mono-samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Mono Samples

on:
pull_request:
paths:
- "core/mono-samples/**.c"
- "core/mono-samples/**.config"
- "core/mono-samples/**.cs"
- "core/mono-samples/**.csproj"
- "core/mono-samples/**.html"
- "core/mono-samples/**.java"
- "core/mono-samples/**.js"
- "core/mono-samples/**.m"
- "core/mono-samples/**.py"
- "core/mono-samples/**.txt"
branches: [ master ]

env:
DOTNET_INSTALLER_CHANNEL: '6.0.100-alpha.1.20531.2'
DOTNET_DO_INSTALL: 'true'

jobs:
build-mono:
runs-on: macos-latest
steps:
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 #@v2
- name: Setup .NET SDK 6
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
run: |
echo "Downloading dotnet-install.sh"
curl https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.sh --output dotnet-install.sh
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
chmod +x ./dotnet-install.sh
./dotnet-install.sh -InstallDir ~/.dotnet -Version ${{ env.DOTNET_INSTALLER_CHANNEL }}
- name: Publish mono iOS sample
run: |
cd ./core/mono-samples/iOS
dotnet publish /p:RunningOnCI=True
4 changes: 3 additions & 1 deletion core/mono-samples/iOS/iOSSampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Runtime.iOS.Sample.Mono" Version="6.0.0-$(BundledNETCoreAppPackageVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Runtime.iOS.Sample.Mono" Version="$(BundledNETCoreAppPackageVersion)" GeneratePathProperty="true" />
</ItemGroup>

<UsingTask TaskName="AppleAppBuilderTask"
Expand Down Expand Up @@ -42,7 +42,9 @@
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>
</Target>

<Target Name="LaunchApp" AfterTargets="BuildAppBundle" Condition="'$(RunningOnCI)' == ''">
<Message Importance="High" Text="Xcode: $(XcodeProjectPath)" />
<Message Importance="High" Text="App: $(AppBundlePath)" />
<Message Importance="High" Text="Restarting device" />
Expand Down

0 comments on commit 7ae0606

Please sign in to comment.