Create Release #873
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
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'alpha' | |
| - 'beta' | |
| - 'dev' | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| permissions: | |
| id-token: write | |
| contents: write | |
| actions: write | |
| checks: write | |
| issues: write | |
| pull-requests: write | |
| name: Create Release | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| path: [samples/BlazorApplicationInsights.Sample.Wasm] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Dotnet Build | |
| run: dotnet build -c Release | |
| - name: Run App | |
| working-directory: ${{ matrix.path }} | |
| run: Start-Process dotnet 'run','-c','Release','--launch-profile','https' -PassThru | |
| shell: pwsh | |
| - name: Install Playwright | |
| working-directory: tests/BlazorApplicationInsights.Tests/bin/Release/net9.0 | |
| run: ./playwright.ps1 install --with-deps | |
| shell: pwsh | |
| - name: Run Tests | |
| working-directory: tests/BlazorApplicationInsights.Tests | |
| run: dotnet test -c Release --logger "trx;LogFileName=test-results.trx" | |
| - name: Test Report | |
| uses: dorny/test-reporter@v2 | |
| if: success() || failure() | |
| with: | |
| name: KubeUI Tests | |
| path: tests/BlazorApplicationInsights.Tests/TestResults/test-results.trx | |
| reporter: dotnet-trx | |
| build: | |
| name: Create Release | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Dotnet Build | |
| run: dotnet build -c Release | |
| - name: Dotnet Publish | |
| working-directory: samples/BlazorApplicationInsights.Sample.Wasm | |
| run: dotnet publish -c Release | |
| - name: Deploy | |
| run: npx netlify deploy ${{ (github.ref == 'refs/heads/master' && '--prod') || '' }} --json -d samples/BlazorApplicationInsights.Sample.Wasm/bin/Release/net8.0/publish/wwwroot | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
| - name: Semantic Release | |
| uses: cycjimmy/semantic-release-action@v4 | |
| id: semantic | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Dotnet Pack | |
| working-directory: src/BlazorApplicationInsights | |
| run: dotnet pack -c Release -p:Version=${{ (steps.semantic.outputs.new_release_published && steps.semantic.outputs.new_release_version) || '0.0.1' }} | |
| - name: NuGet login (OIDC → temp API key) | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: IvanJosipovic | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: NuGet Package | |
| path: src/**/*.nupkg | |
| - name: Dotnet Nuget Push | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| working-directory: src/BlazorApplicationInsights/bin/Release | |
| run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{steps.login.outputs.NUGET_API_KEY}} |