-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(build) Update to latest edition of cake.recipe
- Loading branch information
1 parent
e60a28e
commit 4a832d9
Showing
9 changed files
with
108 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"cake.tool": { | ||
"version": "0.38.4", | ||
"commands": [ | ||
"dotnet-cake" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
- "release/**" | ||
- "hotfix/**" | ||
- "feature/**" | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
env: | ||
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }} | ||
AZURE_SOURCE: ${{ secrets.AZURE_SOURCE }} | ||
AZURE_USER: ${{ secrets.AZURE_USER }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GITTER_ROOM_ID: ${{ secrets.GITTER_ROOM_ID }} | ||
GITTER_TOKEN: ${{ secrets.GITTER_TOKEN }} | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
NUGET_SOURCE: "https://api.nuget.org/v3/index.json" | ||
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | ||
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | ||
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} | ||
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} | ||
WYAM_ACCESS_TOKEN: ${{ secrets.WYAM_ACCESS_TOKEN }} | ||
WYAM_DEPLOY_BRANCH: "gh-pages" | ||
WYAM_DEPLOY_REMOTE: ${{ github.event.repository.html_url }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
sumbodules: true | ||
- name: Fetch all tags and branches | ||
run: git fetch --prune --unshallow | ||
- name: Install Transifex Client | ||
if: ${{ runner.os }} == 'ubuntu-latest' # We do not need it for anything else | ||
run: sudo apt-get install transifex-client -y | ||
- name: Cache Tools | ||
uses: actions/[email protected] | ||
with: | ||
path: tools | ||
key: ${{ runner.os }}-tools-${{ hashFiles('setup.cake') }} | ||
- name: Build Addin | ||
uses: cake-build/cake-action@v1 | ||
with: | ||
script-path: setup.cake | ||
target: CI | ||
verbosity: Diagnostic | ||
cake-version: 0.38.4 | ||
cake-bootstrap: true | ||
- name: Upload artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ matrix.os }}-artifacts | ||
path: | | ||
BuildArtifacts/report.html | ||
BuildArtifacts/packages/**/*.nupkg | ||
BuildArtifacts/**/coverlet/*.xml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,146 +1,20 @@ | ||
$SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition | ||
$TOOLS_DIR = "$SCRIPT_DIR/tools" | ||
if ($IsMacOS -or $IsLinux) { | ||
$CAKE_EXE = "$TOOLS_DIR/dotnet-cake" | ||
} | ||
else { | ||
$CAKE_EXE = "$TOOLS_DIR/dotnet-cake.exe" | ||
} | ||
|
||
$DOTNET_EXE = "$(Get-Command dotnet -ea 0 | select -Expand Source)" | ||
$INSTALL_NETCORE = $false | ||
[string[]]$DOTNET_SDKS = "" | ||
[string]$CAKE_VERSION = "" | ||
foreach ($line in Get-Content "$SCRIPT_DIR/build.config" -Encoding utf8) { | ||
if ($line -like "CAKE_VERSION=*") { | ||
$CAKE_VERSION = $line.Substring($line.IndexOf('=') + 1) | ||
} | ||
elseif ($line -like "DOTNET_SDKS=*") { | ||
$DOTNET_SDKS = $line.Substring($line.IndexOf('=') + 1) -split ',' | ||
} | ||
} | ||
|
||
if ([string]::IsNullOrWhiteSpace($CAKE_VERSION) -or !$DOTNET_SDKS) { | ||
"An errer occured while parsing Cake / .NET Core SDK version." | ||
return 1 | ||
} | ||
|
||
if ($IsMacOS -or $IsLinux) { | ||
$PathSep = ":" | ||
} | ||
else { | ||
$PathSep = ";" | ||
} | ||
|
||
if (Test-Path "$SCRIPT_DIR/.dotnet") { | ||
$env:PATH = "$SCRIPT_DIR/.dotnet${PathSep}${env:PATH}" | ||
$env:DOTNET_ROOT = "$SCRIPT_DIR/.dotnet" | ||
$DOTNET_EXE = Get-ChildItem -Path "$SCRIPT_DIR/.dotnet/dotnet*" -Exclude "*.ps1" | select -First 1 -Expand FullName | ||
} | ||
|
||
if ([string]::IsNullOrWhiteSpace($DOTNET_EXE)) { | ||
$INSTALL_NETCORE = $true | ||
} | ||
elseif (($DOTNET_SDKS | ? { $_ -ne 'ANY' })) { | ||
foreach ($sdk in $DOTNET_SDKS) { | ||
$re = "^\s*$([regex]::Escape($sdk))\s+" | ||
$DOTNET_INSTALLED_VERSION = . $DOTNET_EXE --list-sdks 2>&1 | ? { $_ -match $re } | ||
if (!$DOTNET_INSTALLED_VERSION) { | ||
$INSTALL_NETCORE = $true | ||
break | ||
} | ||
} | ||
} | ||
$ErrorActionPreference = 'Stop' | ||
|
||
if ($true -eq $INSTALL_NETCORE) { | ||
if (!(Test-Path "$SCRIPT_DIR/.dotnet")) { | ||
New-Item -Path "$SCRIPT_DIR/.dotnet" -ItemType Directory -Force | Out-Null | ||
} | ||
function Run([string[]]$arguments) { | ||
$proc = Start-Process "dotnet" $arguments -PassThru -NoNewWindow | ||
Wait-Process -InputObject $proc | ||
|
||
$ScriptPath = "" | ||
$LaunchUrl = "" | ||
$ScriptUrl = "" | ||
|
||
if ($IsMacOS -or $IsLinux) { | ||
$ScriptPath = "$SCRIPT_DIR/.dotnet/dotnet-install.sh" | ||
$ScriptUrl = "https://dot.net/v1/dotnet-install.sh" | ||
$LaunchUrl = "$(Get-Command bash)" | ||
} | ||
else { | ||
$ScriptPath = "$SCRIPT_DIR/.dotnet/dotnet-install.ps1" | ||
$ScriptUrl = "https://dot.net/v1/dotnet-install.ps1" | ||
$LaunchUrl = "$ScriptPath" | ||
} | ||
(New-Object System.Net.WebClient).DownloadFile($ScriptUrl, $ScriptPath) | ||
|
||
foreach ($DOTNET_VERSION in $DOTNET_SDKS) { | ||
$arguments = @() | ||
if ($IsMacOS -or $IsLinux) { | ||
$arguments = @( | ||
$ScriptPath | ||
"--install-dir" | ||
"$SCRIPT_DIR/.dotnet" | ||
"--no-path" | ||
) | ||
if ($DOTNET_VERSION -ne "ANY") { | ||
$arguments += @( | ||
"--version" | ||
"$DOTNET_VERSION" | ||
) | ||
} | ||
} | ||
else { | ||
$arguments = @{ | ||
InstallDir = "$SCRIPT_DIR/.dotnet" | ||
NoPath = $true | ||
Version = "$DOTNET_VERSION" | ||
} | ||
} | ||
|
||
& $LaunchUrl @arguments | ||
} | ||
|
||
$env:PATH = "$SCRIPT_DIR/.dotnet${PathSep}${env:PATH}" | ||
$env:DOTNET_ROOT = "$SCRIPT_DIR/.dotnet" | ||
|
||
$DOTNET_EXE = Get-ChildItem -Path "$SCRIPT_DIR/.dotnet/dotnet*" -Exclude "*.ps1" | select -First 1 -Expand FullName | ||
|
||
} | ||
elseif (Test-Path "/opt/dotnet/sdk" -ea 0) { | ||
$env:DOTNET_ROOT = "/opt/dotnet/sdk" | ||
if ($proc.ExitCode -ne 0) { | ||
"Non-Zero exit code ($($proc.ExitCode)), exiting..." | ||
exit $proc.ExitCode | ||
} | ||
} | ||
|
||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 | ||
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 | ||
$env:DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER = 0 | ||
Run tool, restore | ||
|
||
$CAKE_INSTALLED_VERSION = Get-Command dotnet-cake -ea 0 | % { & $_.Source --version } | ||
Run cake, setup.cake, --bootstrap | ||
|
||
if ($CAKE_INSTALLED_VERSION -eq $CAKE_VERSION) { | ||
$CAKE_EXE = Get-Command dotnet-cake | % Source | ||
} | ||
else { | ||
$CakePath = "$TOOLS_DIR/.store/cake.tool/$CAKE_VERSION" | ||
$CAKE_EXE = (Get-ChildItem -Path $TOOLS_DIR -Filter "dotnet-cake*" -File -ea 0 | select -First 1 -Expand FullName) | ||
|
||
if (!(Test-Path -Path $CakePath -PathType Container) -or !(Test-Path $CAKE_EXE -PathType Leaf)) { | ||
if (!([string]::IsNullOrWhiteSpace($CAKE_EXE)) -and (Test-Path $CAKE_EXE -PathType Leaf)) { | ||
& $DOTNET_EXE tool uninstall --tool-path $TOOLS_DIR Cake.Tool | ||
} | ||
|
||
& $DOTNET_EXE tool install --tool-path $TOOLS_DIR --version $CAKE_VERSION Cake.Tool | ||
if ($LASTEXITCODE -ne 0) { | ||
"An error occured while installing Cake." | ||
return 1 | ||
} | ||
|
||
$CAKE_EXE = (Get-ChildItem -Path $TOOLS_DIR -Filter "dotnet-cake*" -File | select -First 1 -Expand FullName) | ||
} | ||
} | ||
|
||
& "$CAKE_EXE" "$SCRIPT_DIR/setup.cake" --bootstrap | ||
if ($LASTEXITCODE -eq 0) { | ||
& "$CAKE_EXE" "$SCRIPT_DIR/setup.cake" $args | ||
} | ||
$arguments = @("cake"; "setup.cake") | ||
$arguments += @($args) | ||
|
||
return $LASTEXITCODE | ||
Run $arguments |
Oops, something went wrong.