Support first additive tags and grouped macro args #22
This file contains hidden or 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
| name: Build, test, and publish | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - run: dotnet restore | |
| - run: dotnet build --configuration Release --no-restore | |
| - run: dotnet test --configuration Release --no-build | |
| - name: Pack and smoke test consumers | |
| shell: pwsh | |
| run: | | |
| $version = if ($env:GITHUB_REF -like 'refs/tags/v*') { $env:GITHUB_REF_NAME.TrimStart('v') } else { '2.0.4' } | |
| dotnet pack WesnothMarkupLanguage --configuration Release --no-build --output artifacts -p:Version=$version | |
| dotnet restore smoke/Modern/Modern.csproj -p:WmlPackageVersion=$version --configfile smoke/NuGet.Config | |
| dotnet restore smoke/NetFramework/NetFramework.csproj -p:WmlPackageVersion=$version --configfile smoke/NuGet.Config | |
| dotnet build smoke/Modern/Modern.csproj --no-restore -p:WmlPackageVersion=$version | |
| dotnet build smoke/NetFramework/NetFramework.csproj --no-restore -p:WmlPackageVersion=$version | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: artifacts/*.*nupkg | |
| publish: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: validate | |
| runs-on: windows-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: artifacts | |
| - name: Authenticate to NuGet.org with OIDC | |
| id: login | |
| uses: NuGet/login@v1 | |
| with: | |
| user: tbm0115 | |
| - name: Publish package | |
| run: dotnet nuget push "**/*.nupkg" --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Publish symbols | |
| run: dotnet nuget push "**/*.snupkg" --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |