From d1fe591d2755b311a394bd95ab09c1927c26845f Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Tue, 8 May 2018 14:19:33 +1000 Subject: [PATCH 1/6] Adds a Dockerfile Adds a Dockerfile. This image produced by this docker file is based on debian, has all of our required dependencies installed (including audio tools and Mono). It also has PowerShell installed. The docker file also contians the binary assets for a given version. This commit also includes a script to download binary assets from either AppVeyor or Github. That script is included in the docker container so users can update the version of AP.exe they use when running the container. Provisional support is added for building these images when appveyor does CI builds, but I expect changes will need to be made. --- AudioAnalysis.sln | 4 +- appveyor.yml | 15 +++++- build/Dockerfile | 58 ++++++++++++++++++++ build/build_docker.ps1 | 27 ++++++++++ build/download_ap.ps1 | 118 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 build/Dockerfile create mode 100644 build/build_docker.ps1 create mode 100644 build/download_ap.ps1 diff --git a/AudioAnalysis.sln b/AudioAnalysis.sln index c0292efe5..8b16b77a2 100644 --- a/AudioAnalysis.sln +++ b/AudioAnalysis.sln @@ -332,8 +332,8 @@ Global {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Debug|x86.Build.0 = Debug|x86 {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Any CPU.Build.0 = Release|Any CPU - {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.Build.0 = Release|x86 + {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.Build.0 = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|x64.ActiveCfg = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|x64.Build.0 = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|x86.ActiveCfg = Release|x86 diff --git a/appveyor.yml b/appveyor.yml index 54202ffa2..dc595b571 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,6 +37,12 @@ environment: # An encrypted token that allows deploying to GitHub (registered to @atruskie) GH_CREATE_RELEASES_TOKEN: secure: iVfuU5KWiUqXeahc+j7hfQPquJFuxRXnLJajRBE94PGxkliT2GGaXkxJGJVCBDPW + # These are the personal credentials of someone with access to the personal + # account / organization that we want to push to + DOCKER_USER: + secure: A6mk2EeHQsCrlZnK7vwzAA== + DOCKER_PASS: + secure: eTD4d8vJCQW3CCNqGLKU2e79BhEeBVt6TxFMjy3f/KQ= # Before the clone occurs init: @@ -56,6 +62,7 @@ before_build: - nuget restore # Debugging a dirty flag in build version - git status + - docker version build_script: - echo "Building Debug" @@ -118,13 +125,19 @@ deploy: description: "$(ApReleaseMessage)" auth_token: $(GH_CREATE_RELEASES_TOKEN) artifact: DebugPackage,ReleasePackage - prerelease: true + prerelease: false on: # Do not create new releases unless this is the master branch branch: master # Do not create a new release unless this was a scheduled build or a forced build SHOULD_RELEASE: True +# scripts to run after deployment +after_deploy: + # build and push our docker image + - ps: docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS" + - ps: . .\build\build_docker.ps1 "$env:ApVersion" + notifications: - provider: Email diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 000000000..e93ba7c11 --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,58 @@ +FROM debian:stretch-slim + +ARG GIT_COMMIT +ARG AP_SOURCE="github" +ARG AP_VERSION="latest" + +LABEL maintainer="Anthony Truskinger " \ + description="Debian environment for running AnalysisPrograms.exe" \ + version="1.0" \ + org.ecosounds.name="AnalysisPrograms.exe" \ + org.ecosounds.version=${AP_VERSION} \ + org.ecosounds.vendor="QUT Ecoacoustics" \ + org.ecosounds.url="https://github.com/QutEcoacoustics/audio-analysis" \ + org.ecosounds.vcs-url="https://github.com/QutEcoacoustics/audio-analysis" \ + org.ecosounds.vcs-ref=${GIT_COMMIT} \ + org.ecosounds.schema-version="1.0" + + + +# Install system components (used by powershell. and AP as well) +RUN apt-get update && apt-get install -y curl gnupg apt-transport-https unzip \ + readline-common software-properties-common \ + wavpack libsox-fmt-all sox shntool libav-tools ffmpeg \ + # link ffmpeg to /usr/bin/local + && ln -s /usr/bin/ffmpeg /usr/local/bin/ffmpeg \ + && ln -s /usr/bin/ffprobe /usr/local/bin/ffprobe + +# install mp3splt +RUN add-apt-repository "deb http://mp3splt.sourceforge.net/repository unstable main" \ + && apt-get update --allow-unauthenticated \ + && apt-get -y --allow-unauthenticated install libmp3splt0-mp3 libmp3splt0-ogg libmp3splt0-flac libmp3splt-doc libmp3splt-dev mp3splt mp3splt-gtk + +# Mono +RUN \ + # Add mono key server + curl https://origin-download.mono-project.com/repo/xamarin.gpg | apt-key add - \ + # install mono + echo "deb http://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list \ + && apt-get update \ + && apt-get install -y mono-complete \ + && rm -rf /var/lib/apt/lists/* /tmp/* + +# Powershell +RUN \ + # Import the public repository GPG keys + curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + # Register the Microsoft Product feed + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list \ + # Update the list of products + && apt-get update \ + # Install PowerShell + && apt-get install -y --no-install-recommends powershell + +# Install AP.exe +ADD download_ap.ps1 /download_ap.ps1 +RUN /usr/bin/pwsh -NonInteractive -c "/download_ap.ps1 ${AP_SOURCE} -version ${AP_VERSION}" + +ENTRYPOINT [ "/bin/bash" ] diff --git a/build/build_docker.ps1 b/build/build_docker.ps1 new file mode 100644 index 000000000..2eaab80c7 --- /dev/null +++ b/build/build_docker.ps1 @@ -0,0 +1,27 @@ +#!/usr/bin/pwsh + +# builds and pushes a docker file to docker hub +# currently only builds the 'stable' tag, which is applied to whatever version +# is supplied to this script. +# Future work: allow this script to build our 'Weekly' and 'Continuous' lines +# as their own containers. +param( + # Version tag + [Parameter(Mandatory=$true)] + [string] + $version +) + +# get the current git commit +$GIT_COMMIT=git log -1 --format=%H + +docker build ` + -t qutecoacoustics/audio-analysis:stable ` + -t qutecoacoustics/audio-analysis:latest ` + -t qutecoacoustics/audio-analysis:$version ` + . ` + --build-arg GIT_COMMIT=$GIT_COMMIT ` + --build-arg AP_SOURCE="github" ` + --build-arg AP_VERSION=$version + +docker push qutecoacoustics/audio-analysis:stable diff --git a/build/download_ap.ps1 b/build/download_ap.ps1 new file mode 100644 index 000000000..b05618cb8 --- /dev/null +++ b/build/download_ap.ps1 @@ -0,0 +1,118 @@ +#!/usr/bin/pwsh + +# Downloads bianry assets for AP.exe +param( + # the source to get the binary from either 'github' or 'appveyor' + [Parameter(Position=0)] + [ValidateSet('github','appveyor')] + [string]$source, + + # The version to download. Use 'latest' to get the latest version. + # Use an actual version number ('18.03.4.1') to get a speicific github version. + # Use the AppVeyor build ID ('314') to get a specific appveyor build. + [Parameter()] + [string]$version = "latest", + + # Which build to get, either 'Debug' or 'Release', defaults to 'Release' + [Parameter()] + [ValidateSet('Release','Debug')] + [string]$build = "Release", + + + # Directory to extract binary to. Defaults to "/AP" ("C:\AP" on Windows) + [Parameter()] + [string]$destination = "/AP" +) + +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +# resolve metadata for asset +if ($source -eq "github") { + $github_url = "https://api.github.com/repos/QutEcoacoustics/audio-analysis/releases" + if ($version -eq "latest") { + $github_url += "/latest" + } + else { + # strip the leading v if it is present + $version = $version -replace "^v","" + $github_url += "/tags/v$version" + } + + $response = Invoke-RestMethod -Method Get -Uri $github_url + $asset_url = $response.assets ` + | Where-Object { $_.name -like "$build*" } ` + | ForEach-Object browser_download_url + Write-Output "Downloading release $($response.tag_name) from GitHub" +} +elseif ($source -eq "appveyor") { + $appveyor_api = "https://ci.appveyor.com/api" + $appveyor_project_url = "$appveyor_api/projects/QUTEcoacousticsResearchGroup/audio-analysis" + + # get the last 50 builds + $response = Invoke-RestMethod -Method Get -Uri "$appveyor_project_url/history?recordsNumber=50" + + # filter builds for master branch and build success + $ci_builds = $response.builds ` + | Where-Object { $_.status -eq "success" -and $_.branch -eq "master" } ` + | Sort-Object finished -Descending + if ($version -eq "latest") { + $ci_build = $ci_builds[0] + } + else { + $ci_build = $ci_builds | Where-Object { $_.version -eq $version } + } + + if ($null -eq $ci_build) { + throw "could not find version '$version' in last 50 AppVeyor builds" + } + + # now get the build (we need to do this again because the job sub-object) + # is not included in the build objects when the history is retrieved + $ci_build = (Invoke-RestMethod -Method Get -Uri "$appveyor_project_url/build/$($ci_build.version)").build + $artifacts_url = "$appveyor_api/buildJobs/$($ci_build.jobs[0].jobId)/artifacts" + $artifacts = Invoke-RestMethod -Method Get -Uri $artifacts_url + + $file_name = ($artifacts | Where-Object { $_.fileName -like "*$build*" }).fileName + + $asset_url = "$artifacts_url/$file_name" + Write-Output "Downloading version $($ci_build.version) from AppVeyor" +} +else { + throw "unknown source '$source'" +} + + +# remove directory if it already exists +if (Test-Path $destination) { + Write-Warning "Deleting old installation at '$destination'" + Remove-Item $destination -Recurse -ErrorAction Stop + Start-Sleep 1 +} +New-Item $destination -ItemType Directory -ErrorAction Stop + +try { + Push-Location $destination + + # download asset using system native curl + Write-Output "Downloading asset $asset_url" + $curl = Get-Command curl* -CommandType Application + & $curl -L -O "$asset_url" + if ($LASTEXITCODE -ne 0) { + throw "failed downloading $asset_url" + } + + $downloaded_zip = Get-ChildItem "$build*.zip" + + unzip -o $downloaded_zip + if ($LASTEXITCODE -ne 0) { + throw "failed extracting zip $downloaded_zip" + } + + Remove-Item $downloaded_zip + + Write-Output "Download complete, installed to $destination" + +} +finally { + Pop-Location +} From f5e027abd11302279f91ae98c2580b3d8a5d39ac Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Tue, 8 May 2018 14:25:18 +1000 Subject: [PATCH 2/6] Fixes a bug in EventStatistics This patch ensures that the audio recording duration used by event statistics is always rounded down to the nearest second. There is a subtle conflict in logic later on in the event downloading code that requires audio segments be rounded to the nearest second. If the recording duration is greater than 0.5, and the event ends at the end of the recording, then the requested media is rounded up to the next second, past the end of the recording. This patch prevents that error. --- src/Acoustics.Shared/Extensions/DoubleExtensions.cs | 2 ++ .../EventMetadataResolver.cs | 4 +++- src/AnalysisPrograms/EventStatistics/ImportedEvent.cs | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Acoustics.Shared/Extensions/DoubleExtensions.cs b/src/Acoustics.Shared/Extensions/DoubleExtensions.cs index d89cc2591..ff53fedc8 100644 --- a/src/Acoustics.Shared/Extensions/DoubleExtensions.cs +++ b/src/Acoustics.Shared/Extensions/DoubleExtensions.cs @@ -48,5 +48,7 @@ public static double RoundToSignficantDigits(this double d, int digits) decimal scale = (decimal)Math.Pow(10, Math.Floor(Math.Log10((double)Math.Abs(dec))) + 1); return (double)(scale * Math.Round(dec / scale, digits, MidpointRounding.AwayFromZero)); } + + public static double Floor(this double d) => Math.Floor(d); } } diff --git a/src/AnalysisPrograms/AcousticWorkbench.Orchestration/EventMetadataResolver.cs b/src/AnalysisPrograms/AcousticWorkbench.Orchestration/EventMetadataResolver.cs index 412a3fb80..da991c0b0 100644 --- a/src/AnalysisPrograms/AcousticWorkbench.Orchestration/EventMetadataResolver.cs +++ b/src/AnalysisPrograms/AcousticWorkbench.Orchestration/EventMetadataResolver.cs @@ -188,7 +188,9 @@ private async Task> DownloadRemoteMetadata( $"Metadata for audio recording media {audioRecordingId} retrieved, generating segments for associated events"); // now generate the segments - var limit = audioRecording.DurationSeconds.AsRangeFromZero(); + // we need to floor the duration to ensure later rounding does round past the limit of the recording + Log.Verbose($"Audio recording duration {audioRecording.DurationSeconds} will be floored"); + var limit = audioRecording.DurationSeconds.Floor().AsRangeFromZero(); var results = new List(20); foreach (var importedEvent in events) { diff --git a/src/AnalysisPrograms/EventStatistics/ImportedEvent.cs b/src/AnalysisPrograms/EventStatistics/ImportedEvent.cs index efbc5afea..4edb64713 100644 --- a/src/AnalysisPrograms/EventStatistics/ImportedEvent.cs +++ b/src/AnalysisPrograms/EventStatistics/ImportedEvent.cs @@ -10,6 +10,7 @@ namespace AnalysisPrograms.EventStatistics using System.Reflection; using System.Text; using System.Threading.Tasks; + using Acoustics.Shared; using AcousticWorkbench; using CsvHelper.Configuration; using log4net; @@ -44,6 +45,15 @@ public bool IsValid() && this.HighFrequencyHertz.HasValue); } + /// + /// Returns a JSON encoded string that describes this object. + /// + /// The string that describes this object. + public override string ToString() + { + return Json.SerialiseToString(this); + } + public sealed class ImportedEventNameClassMap : CsvClassMap { private static readonly PropertyInfo[] Properties = typeof(ImportedEvent).GetProperties(); From 5b822975db66f2cfa38247cbf76d4fb142753bc5 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Tue, 8 May 2018 14:26:21 +1000 Subject: [PATCH 3/6] Fixes a bug in ProcessRunner Asking for the exit code before the process has ended (or in the case of the timeout handling code, killed), will cause an exception. --- src/Acoustics.Shared/ProcessRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Acoustics.Shared/ProcessRunner.cs b/src/Acoustics.Shared/ProcessRunner.cs index 3b0f45018..a98bc7d65 100644 --- a/src/Acoustics.Shared/ProcessRunner.cs +++ b/src/Acoustics.Shared/ProcessRunner.cs @@ -405,7 +405,7 @@ private void ProcessTimeout(string arguments, string workingDirectory, int retry { if (Log.IsVerboseEnabled()) { - Log.Verbose(this.instanceId + ": Process timeout handling code. Exit code: " + this.process.ExitCode); + Log.Verbose(this.instanceId + ": Process timeout handling code... Attempting to kill process"); } this.process.Refresh(); From 6fafa446eafc9f2bf6698fe97749b6366038d857 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Tue, 8 May 2018 14:39:05 +1000 Subject: [PATCH 4/6] Reduces output in test logging --- AudioAnalysis.sln | 4 ++-- tests/Acoustics.Test/InfiniteTextStreamTests.cs | 4 ++-- tests/Acoustics.Test/Shared/CsvTests.cs | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AudioAnalysis.sln b/AudioAnalysis.sln index c0292efe5..8b16b77a2 100644 --- a/AudioAnalysis.sln +++ b/AudioAnalysis.sln @@ -332,8 +332,8 @@ Global {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Debug|x86.Build.0 = Debug|x86 {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Any CPU.Build.0 = Release|Any CPU - {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.Build.0 = Release|x86 + {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|Mixed Platforms.Build.0 = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|x64.ActiveCfg = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|x64.Build.0 = Release|Any CPU {7C6831FD-F60C-4F7B-8E6A-35E850174411}.Release|x86.ActiveCfg = Release|x86 diff --git a/tests/Acoustics.Test/InfiniteTextStreamTests.cs b/tests/Acoustics.Test/InfiniteTextStreamTests.cs index 97ec00e0b..22195704f 100644 --- a/tests/Acoustics.Test/InfiniteTextStreamTests.cs +++ b/tests/Acoustics.Test/InfiniteTextStreamTests.cs @@ -62,7 +62,7 @@ void Generate() Assert.IsTrue(s.Length > 1_000); - Debug.WriteLine(s); + //Debug.WriteLine(s); } [TestMethod] @@ -103,7 +103,7 @@ void Generate() Assert.IsTrue(s.Length > 10_000); - Debug.WriteLine(s); + //Debug.WriteLine(s); } } } \ No newline at end of file diff --git a/tests/Acoustics.Test/Shared/CsvTests.cs b/tests/Acoustics.Test/Shared/CsvTests.cs index 1cf277951..fb2760e76 100644 --- a/tests/Acoustics.Test/Shared/CsvTests.cs +++ b/tests/Acoustics.Test/Shared/CsvTests.cs @@ -449,7 +449,9 @@ private void AssertCsvEqual(string expected, FileInfo actual) var lines = File.ReadAllText(actual.FullName); Assert.AreEqual(expected, lines); - Debug.WriteLine(lines); + + //Debug.WriteLine(lines); + CollectionAssert.AreEqual(expected.ToArray(), lines.ToArray()); } From bd5b178c3f61fc6a43fbe0a8a879b7d5519ddf71 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Mon, 21 May 2018 10:32:19 +1000 Subject: [PATCH 5/6] [CI] Fixes duplicate tag release detection --- appveyor.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index dc595b571..4c2d181b3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,9 +55,13 @@ before_build: - git lfs pull # Determine whether or not we should tag and release # if the last tag hash matches the current build hash then we should not duplicate a release - - ps: $env:TAG_NOT_PREVIOUSLY_RELEASED = ($(git tag -l --format="%(objectname)") -notcontains $env:APPVEYOR_REPO_COMMIT) - - ps: $env:RELEASE_COMMIT = $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -ilike "*``[release``]*"; $env:SHOULD_RELEASE = ($env:RELEASE_COMMIT -ieq "true") -or ($env:APPVEYOR_SCHEDULED_BUILD -and ($env:TAG_NOT_PREVIOUSLY_RELEASED -ieq "true")); - - ps: ls env:* -Include SHOULD*,APPVEYOR_SCHEDULED_BUILD*,APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED*,RELEASE_COMMIT,TAG_NOT_PREVIOUSLY_RELEASED + - ps: | + $tags = git log --tags -n 10 --no-walk --format="%H %D" + Write-Output ("Recent tags:`n" + ($tags | Out-String)) + $env:TAG_NOT_PREVIOUSLY_RELEASED=($tags -like "$env:APPVEYOR_REPO_COMMIT*").Length -eq 0 + $env:RELEASE_COMMIT = $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -ilike "*``[release``]*" + $env:SHOULD_RELEASE = ($env:RELEASE_COMMIT -ieq "true") -or ($env:APPVEYOR_SCHEDULED_BUILD -and ($env:TAG_NOT_PREVIOUSLY_RELEASED -ieq "true")) + ls env:* -Include SHOULD*,APPVEYOR_SCHEDULED_BUILD*,APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED*,RELEASE_COMMIT,TAG_NOT_PREVIOUSLY_RELEASED # Restore packages - nuget restore # Debugging a dirty flag in build version From 8cff73c2d86fd937ab00f73958d0006e5368e5ee Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Mon, 21 May 2018 10:52:47 +1000 Subject: [PATCH 6/6] [CI] Fixes indentation in config Bug introduced in bd5b178c3f61fc6a43fbe0a8a879b7d5519ddf71 --- appveyor.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4c2d181b3..182da9d65 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,7 +48,6 @@ environment: init: #- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - echo Starting Build - #- git lfs install --skip-smudge before_build: # Download fresh lfs assets @@ -56,12 +55,12 @@ before_build: # Determine whether or not we should tag and release # if the last tag hash matches the current build hash then we should not duplicate a release - ps: | - $tags = git log --tags -n 10 --no-walk --format="%H %D" - Write-Output ("Recent tags:`n" + ($tags | Out-String)) - $env:TAG_NOT_PREVIOUSLY_RELEASED=($tags -like "$env:APPVEYOR_REPO_COMMIT*").Length -eq 0 - $env:RELEASE_COMMIT = $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -ilike "*``[release``]*" - $env:SHOULD_RELEASE = ($env:RELEASE_COMMIT -ieq "true") -or ($env:APPVEYOR_SCHEDULED_BUILD -and ($env:TAG_NOT_PREVIOUSLY_RELEASED -ieq "true")) - ls env:* -Include SHOULD*,APPVEYOR_SCHEDULED_BUILD*,APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED*,RELEASE_COMMIT,TAG_NOT_PREVIOUSLY_RELEASED + $tags = git log --tags -n 10 --no-walk --format="%H %D" + Write-Output ("Recent tags:`n" + ($tags | Out-String)) + $env:TAG_NOT_PREVIOUSLY_RELEASED=($tags -like "$env:APPVEYOR_REPO_COMMIT*").Length -eq 0 + $env:RELEASE_COMMIT = $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -ilike "*``[release``]*" + $env:SHOULD_RELEASE = ($env:RELEASE_COMMIT -ieq "true") -or ($env:APPVEYOR_SCHEDULED_BUILD -and ($env:TAG_NOT_PREVIOUSLY_RELEASED -ieq "true")) + ls env:* -Include SHOULD*,APPVEYOR_SCHEDULED_BUILD*,APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED*,RELEASE_COMMIT,TAG_NOT_PREVIOUSLY_RELEASED # Restore packages - nuget restore # Debugging a dirty flag in build version