Skip to content

release

release #2

Workflow file for this run

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