diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml
deleted file mode 100644
index e8e06a9..0000000
--- a/.azure/pipelines/ci.yml
+++ /dev/null
@@ -1,85 +0,0 @@
-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: 'Install .NET SDK'
- inputs:
- packageType: sdk
- useGlobalJson: true
-- task: UseDotNet@2
- displayName: 'Install .NET 6.0 runtime'
- inputs:
- packageType: runtime
- 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'
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7d35222..955d620 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,21 +11,22 @@ on:
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]
+ name: build-and-test
+ runs-on: windows-latest
steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-dotnet@v4
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- - name: restore
- run: dotnet restore ./src
+
- name: build
- run: dotnet build ./src/Dax.Formatter.sln --configuration Release --no-restore
+ run: dotnet build ./src/Dax.Formatter.sln --configuration Release
+
- name: test
run: dotnet test ./src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj --configuration Release --no-build --verbosity normal
+
- name: pack
- run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration Release --no-build --no-restore --verbosity normal
\ No newline at end of file
+ run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration Release --no-build
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..142a332
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,45 @@
+name: release
+
+on:
+ workflow_dispatch:
+
+permissions:
+ contents: write
+
+jobs:
+ release:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - uses: actions/setup-dotnet@v5
+ with:
+ global-json-file: global.json
+
+ - uses: dotnet/nbgv@v0.4
+ id: nbgv
+
+ - name: restore signing key
+ run: |
+ $bytes = [Convert]::FromBase64String("${{ secrets.SIGNING_KEY }}")
+ [IO.File]::WriteAllBytes("src/Dax.Formatter/DaxFormatter.snk", $bytes)
+ shell: pwsh
+
+ - name: build
+ run: dotnet build ./src/Dax.Formatter.sln --configuration Release
+
+ - name: test
+ run: dotnet test ./src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj --configuration Release --no-build --verbosity normal
+
+ - name: pack
+ run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration Release --no-build --output ./artifacts
+
+ - name: push to nuget.org
+ run: dotnet nuget push "./artifacts/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
+
+ - name: create github release
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh release create "v${{ steps.nbgv.outputs.NuGetPackageVersion }}" --title "DaxFormatter v${{ steps.nbgv.outputs.NuGetPackageVersion }}" --target "${{ github.sha }}" --generate-notes --draft
diff --git a/.gitignore b/.gitignore
index 4ce6fdd..02fabfb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -226,7 +226,7 @@ orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
+*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
diff --git a/src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj b/src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj
index 85273ba..597dd26 100644
--- a/src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj
+++ b/src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj
@@ -2,19 +2,18 @@
net472;net8.0;net10.0
- latest
- enable
false
+ $(NoWarn);CA1707;CA1515
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Dax.Formatter/AssemblyInfo.cs b/src/Dax.Formatter/AssemblyInfo.cs
index 628609e..4ed6afd 100644
--- a/src/Dax.Formatter/AssemblyInfo.cs
+++ b/src/Dax.Formatter/AssemblyInfo.cs
@@ -1,10 +1,4 @@
-using System;
using System.Runtime.CompilerServices;
-#if SIGNED
-[assembly: InternalsVisibleTo("Dax.Formatter.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d1aa2171c79e736b0fbb1638d667e2a4d04e72f2817328e9d31e211d2f7291cef9cbf0321ed2af5c73d6d7fcf375c5641232285b15b9cf3a42e98f9c5f0e2e4726ea0a60d458892f48b395909997fa92a4fa9f8c4da3c056cddecff7e627dc3eb63187c92912a6fb43783e672d9552c0dc05ca446e6c0bd5b0dcd4b47973fbbc")]
-#else
[assembly: InternalsVisibleTo("Dax.Formatter.Tests")]
-#endif
-
-[assembly: CLSCompliant(true)]
\ No newline at end of file
+[assembly: CLSCompliant(true)]
diff --git a/src/Dax.Formatter/Dax.Formatter.csproj b/src/Dax.Formatter/Dax.Formatter.csproj
index dc3ef9a..26fd0e4 100644
--- a/src/Dax.Formatter/Dax.Formatter.csproj
+++ b/src/Dax.Formatter/Dax.Formatter.csproj
@@ -1,25 +1,15 @@
-
+
netstandard2.0;net8.0;net10.0
- latest
- enable
en-US
true
-
-
- 1.0.0.0
- 1.0.0
- 1.0.0
- dev
Dax.Formatter
SQLBI
-
Alberto Spelta, Marco Russo
Dax Formatter client libraries
This client library connects to daxformatter.com service to format DAX expressions.
-
Dax.Formatter
DAX;FORMATTER;SQLBI;TABULAR;SSAS
package-icon.png
@@ -28,16 +18,11 @@
https://github.com/sql-bi/DaxFormatter
https://github.com/sql-bi/DaxFormatter
git
- master
true
true
embedded
-
- true
-
-
@@ -45,11 +30,8 @@
-
-
-
- $(AdditionalConstants)
-
+
+
Dax.Formatter .NET Standard 2.0
@@ -61,4 +43,9 @@
Dax.Formatter .NET 10.0
-
\ No newline at end of file
+
+ true
+ $(MSBuildThisFileDirectory)DaxFormatter.snk
+
+
+
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
new file mode 100644
index 0000000..f2a1eb4
--- /dev/null
+++ b/src/Directory.Build.props
@@ -0,0 +1,20 @@
+
+
+
+ latest
+ enable
+ all
+ latest
+ enable
+ true
+
+
+
+ true
+
+
+
+
+
+
+
diff --git a/version.json b/version.json
new file mode 100644
index 0000000..fc808ab
--- /dev/null
+++ b/version.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
+ "version": "1.2",
+ "assemblyVersion": {
+ "precision": "major"
+ },
+ "nuGetPackageVersion": {
+ "semVer": 2
+ },
+ "publicReleaseRefSpec": [
+ "^refs/heads/master$"
+ ],
+ "pathFilters": [
+ "src/Dax.Formatter"
+ ]
+}