Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions .azure/pipelines/ci.yml

This file was deleted.

23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration Release --no-build
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

<PropertyGroup>
<TargetFrameworks>net472;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CA1707;CA1515</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 1 addition & 7 deletions src/Dax.Formatter/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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)]
[assembly: CLSCompliant(true)]
31 changes: 9 additions & 22 deletions src/Dax.Formatter/Dax.Formatter.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<NeutralLanguage>en-US</NeutralLanguage>
<IsPackable>true</IsPackable>

<!-- version numbers will be updated by build -->
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>

<Title>Dax.Formatter</Title>
<Company>SQLBI</Company>
<!--Copyright>Copyright ©</Copyright-->
<Authors>Alberto Spelta, Marco Russo</Authors>
<Product>Dax Formatter client libraries</Product>
<Description>This client library connects to daxformatter.com service to format DAX expressions.</Description>
<!--Summary>...</Summary-->
<PackageId>Dax.Formatter</PackageId>
<PackageTags>DAX;FORMATTER;SQLBI;TABULAR;SSAS</PackageTags>
<PackageIcon>package-icon.png</PackageIcon>
Expand All @@ -28,28 +18,20 @@
<PackageProjectUrl>https://github.com/sql-bi/DaxFormatter</PackageProjectUrl>
<RepositoryUrl>https://github.com/sql-bi/DaxFormatter</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryBranch>master</RepositoryBranch>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\package-icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="10.0.9" Condition="'$(TargetFramework)' == 'netstandard2.0'" /> </ItemGroup>

<PropertyGroup>
<DefineConstants>$(AdditionalConstants)</DefineConstants>
</PropertyGroup>
<PackageReference Include="System.Text.Json" Version="10.0.9" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<AssemblyTitle>Dax.Formatter .NET Standard 2.0</AssemblyTitle>
Expand All @@ -61,4 +43,9 @@
<AssemblyTitle>Dax.Formatter .NET 10.0</AssemblyTitle>
</PropertyGroup>

</Project>
<PropertyGroup Condition="Exists('$(MSBuildThisFileDirectory)DaxFormatter.snk')">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)DaxFormatter.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

</Project>
20 changes: 20 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AnalysisMode>all</AnalysisMode>
<AnalysisLevel>latest</AnalysisLevel>
<ImplicitUsings>enable</ImplicitUsings>
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.9.50" PrivateAssets="all" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
Loading