Bump Verify from 31.28.0 to 32.0.0 #853
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: .NET | |
| env: | |
| configuration: Release | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| dump: | |
| name: Dump | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: none | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJSON(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - name: Dump event context | |
| env: | |
| EVENT_CONTEXT: ${{ toJSON(github.event) }} | |
| run: echo "$EVENT_CONTEXT" | |
| - name: Dump job context | |
| env: | |
| JOB_CONTEXT: ${{ toJSON(job) }} | |
| run: echo "$JOB_CONTEXT" | |
| - name: Dump environment | |
| run: printenv | sort | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| env: | |
| source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
| outputs: | |
| GitBuildVersionSimple: ${{ steps.version.outputs.GitBuildVersionSimple }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 # full history | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| global-json-file: "global.json" | |
| source-url: ${{ env.source-url }} | |
| env: | |
| NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Build | |
| id: build | |
| run: dotnet build /bl | |
| - name: Get version | |
| id: version | |
| run: | | |
| echo "$GitBuildVersionSimple" | |
| echo "GitBuildVersionSimple=$GitBuildVersionSimple" >> "$GITHUB_OUTPUT" | |
| - name: Dump environment | |
| run: printenv | sort | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal | |
| - name: Pack | |
| run: dotnet pack | |
| - name: Test install | |
| run: | | |
| ls -al Verify.Cli/nupkg | |
| dotnet tool install --global Verify.Cli --source Verify.Cli/nupkg --version $NBGV_SemVer2 | |
| - name: Publish .zip | |
| run: dotnet publish | |
| - name: Create .zip with version number | |
| run: zip -r $GITHUB_WORKSPACE/Verify.Cli.$GitBuildVersionSimple.zip . | |
| working-directory: Verify.Cli/bin/Release/net10.0/publish | |
| - name: Publish Container | |
| run: dotnet publish --os linux --arch x64 --self-contained false /t:PublishContainer Verify.Cli -p ContainerArchiveOutputPath=${{ github.workspace }}/container.tar.gz | |
| - name: Load container | |
| run: | | |
| ls -al | |
| docker load -i container.tar.gz | |
| docker images | |
| - name: Publish Linux | |
| run: dotnet publish -r linux-x64 --self-contained -p:PublishSingleFile=true Verify.Cli | |
| - name: Publish Windows | |
| run: dotnet publish -r win-x64 --self-contained -p:PublishSingleFile=true Verify.Cli | |
| - name: Build logs | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: logs | |
| # A file, directory or wildcard pattern that describes what to upload | |
| path: "*.binlog" | |
| - name: Container Archive | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: container | |
| path: container.tar.gz | |
| - name: List tar contents | |
| run: tar -tvf container.tar.gz | |
| - name: Linux Binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: linux-x64 | |
| path: Verify.Cli/bin/Release/net10.0/linux-x64/publish | |
| - name: Windows Binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: win-x64 | |
| # A file, directory or wildcard pattern that describes what to upload | |
| path: Verify.Cli/bin/Release/net10.0/win-x64/publish | |
| - name: Zip | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: zip | |
| path: Verify.Cli.*.zip | |
| - name: NuGet package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nupkg | |
| path: Verify.Cli/nupkg/*.nupkg | |
| test_images: | |
| name: Test images | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm] | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: container | |
| - name: Display structure of downloaded files | |
| run: | | |
| ls -alR | |
| tar -tvf container.tar.gz | |
| - name: Import Docker image from tar.gz | |
| run: | | |
| docker load -i container.tar.gz | |
| - name: List Docker images | |
| run: | | |
| docker images | |
| docker inspect verify-cli -f "{{.Os}}/{{.Architecture}}" | |
| - name: Run container | |
| run: docker run --rm verify-cli:latest --help | |
| update_release_draft: | |
| name: Update release draft | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| permissions: | |
| contents: write | |
| if: github.ref == 'refs/heads/main' # Running this job only for main branch | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: release-drafter/release-drafter@v7.7.0 | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| version: ${{ needs.build.outputs.GitBuildVersionSimple }} | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -R artifacts | |
| - name: Dump steps context | |
| env: | |
| STEPS_CONTEXT: ${{ toJson(steps) }} | |
| run: echo "$STEPS_CONTEXT" | |
| - name: Upload assets | |
| uses: xresloader/upload-to-github-release@v1 | |
| with: | |
| file: "artifacts/nupkg/*.nupkg;artifacts/container/container.tar.gz" | |
| delete_file: "*.nupkg;*.tar.gz" | |
| overwrite: true | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |