fix: AL0084 test used reserved domain example.com which analyzer corr… #93
Workflow file for this run
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: Publish to NuGet | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (without v prefix)' | |
| required: true | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Determine version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Restore | |
| # Restore WITHOUT Version override - SDK injects published analyzer (1.10.7) | |
| # The Version prop would cause SDK to inject 1.11.0 which doesn't exist yet | |
| run: dotnet restore ANcpLua.Analyzers.slnx | |
| - name: Build | |
| # Build WITH Version - sets assembly version but skips restore | |
| run: dotnet build ANcpLua.Analyzers.slnx -c Release --no-restore -p:Version=${{ steps.version.outputs.version }} | |
| - name: Pack | |
| run: dotnet pack src/ANcpLua.Analyzers/ANcpLua.Analyzers.csproj -c Release -o artifacts --no-build -p:Version=${{ steps.version.outputs.version }} -p:PackageId=ANcpLua.Analyzers | |
| - name: NuGet login (OIDC → temp API key) | |
| id: login | |
| uses: NuGet/login@v1 | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push to NuGet (Trusted Publishing) | |
| run: | | |
| dotnet nuget push artifacts/*.nupkg \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" \ | |
| --skip-duplicate | |
| - name: Push to GitHub Packages | |
| run: | | |
| dotnet nuget push artifacts/*.nupkg \ | |
| --source "https://nuget.pkg.github.com/ANcpLua/index.json" \ | |
| --api-key ${{ secrets.GITHUB_TOKEN }} \ | |
| --skip-duplicate |