-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring pipeline for NuGet release (#12)
* Added MIT LICENSE.md * Updated solution properties - Updated TargetFrameworks to netstandard2.0;net6.0 - Enabled NuGet source link - Enabled nullable * Fix nullable warnings * Updated GH action, added AZ pipeline * Fix nullable warnings * Refactoring disposable and app+version args
- Loading branch information
1 parent
745cd13
commit d436287
Showing
32 changed files
with
419 additions
and
265 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
parameters: | ||
- name: verbosity | ||
displayName: Verbosity | ||
type: string | ||
default: minimal | ||
values: | ||
- minimal | ||
- normal | ||
- detailed | ||
- diagnostic | ||
|
||
trigger: none | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
variables: | ||
configuration: 'Release' | ||
assemblyVersion: '$(AppVersionMajor).0.0.0' | ||
semanticVersion: '$(AppVersionMajor).$(AppVersionMinor).$(AppVersionPatch)' | ||
|
||
steps: | ||
- task: PowerShell@2 | ||
displayName: 'Set variables' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
$versionSuffix = "$(AppVersionSuffix)" | ||
if ($versionSuffix -match "\S") { $versionSuffix = "-$versionSuffix" } | ||
Write-Host "##vso[task.setvariable variable=versionSuffix;]$versionSuffix" | ||
Write-Host "VersionSuffix $versionSuffix" | ||
$packageVersion = "$(semanticVersion)$versionSuffix" | ||
if ("$(isReleaseBuild)" -ne "true") { $packageVersion += "-CI-$(Build.BuildNumber)" } | ||
Write-Host "Set PackageVersion and BuildNumber to '$packageVersion'" | ||
Write-Host "##vso[task.setvariable variable=packageVersion;]$packageVersion" | ||
Write-Host "##vso[build.updatebuildnumber]$packageVersion" | ||
- task: DownloadSecureFile@1 | ||
name: signKey | ||
displayName: 'Download sign key' | ||
inputs: | ||
secureFile: 'DaxFormatter.snk' | ||
- task: UseDotNet@2 | ||
displayName: '.NET setup' | ||
inputs: | ||
packageType: sdk | ||
version: 6.0.x | ||
- task: DotNetCoreCLI@2 | ||
displayName: '.NET restore' | ||
inputs: | ||
command: 'restore' | ||
projects: 'src/**/*.csproj' | ||
feedsToUse: 'select' | ||
verbosityRestore: '${{ parameters.verbosity }}' | ||
- task: DotNetCoreCLI@2 | ||
displayName: '.NET build' | ||
inputs: | ||
command: 'build' | ||
projects: 'src/**/*.csproj' | ||
arguments: '--configuration "$(configuration)" --no-restore --verbosity ${{ parameters.verbosity }} /p:AssemblyVersion="$(assemblyVersion)" /p:FileVersion="$(semanticVersion)" /p:VersionPrefix="$(semanticVersion)" /p:VersionSuffix="$(versionSuffix)" /p:ContinuousIntegrationBuild="true" /p:AdditionalConstants="SIGNED" /p:SignAssembly="true" /p:AssemblyOriginatorKeyFile="$(signKey.secureFilePath)" /m' | ||
- task: DotNetCoreCLI@2 | ||
displayName: '.NET test' | ||
inputs: | ||
command: 'test' | ||
projects: 'src/*Tests/*.csproj' | ||
arguments: '--no-restore --no-build --verbosity ${{ parameters.verbosity }} --logger "trx;LogFilePrefix=testResults" --collect "Code coverage"' | ||
- task: DotNetCoreCLI@2 | ||
displayName: '.NET pack' | ||
inputs: | ||
command: 'pack' | ||
packagesToPack: 'src/Dax.Formatter/Dax.Formatter.csproj' | ||
nobuild: true | ||
versioningScheme: 'byEnvVar' | ||
versionEnvVar: 'packageVersion' | ||
verbosityPack: '${{ parameters.verbosity }}' | ||
- task: PublishPipelineArtifact@1 | ||
displayName: 'Publish artifacts' | ||
inputs: | ||
targetPath: '$(Build.ArtifactStagingDirectory)' | ||
artifact: 'drop' | ||
publishLocation: 'pipeline' |
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,34 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
env: | ||
CONFIGURATION: 'Release' | ||
jobs: | ||
build-and-test: | ||
name: build-and-test--${{ matrix.os-version }} | ||
runs-on: ${{ matrix.os-version }} | ||
strategy: | ||
matrix: | ||
os-version: [windows-latest] #, ubuntu-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: .NET setup | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: .NET info | ||
run: dotnet --info | ||
- name: .NET restore | ||
run: dotnet restore ./src | ||
- name: .NET build | ||
run: dotnet build ./src/Dax.Formatter.sln --configuration ${{ env.CONFIGURATION }} --no-restore | ||
- name: .NET test | ||
run: dotnet test ./src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal | ||
- name: .NET pack | ||
run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration ${{ env.CONFIGURATION }} --no-build --no-restore --verbosity normal |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) SQLBI Corporation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,7 @@ | ||
{ | ||
"sdk": { | ||
"version": "6.0.100", | ||
"allowPrerelease": false, | ||
"rollForward": "latestFeature" | ||
} | ||
} |
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,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<clear /> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
</packageSources> | ||
</configuration> |
File renamed without changes
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
Oops, something went wrong.