Repository navigation
ADO Lens 0.11.1 #25
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: Release | |
| # Pushing a tag vX.Y.Z publishes the release: tests, package, notes from CHANGELOG.md. | |
| # The tag must match <Version> in src/AdoLens/AdoLens.csproj; release tags cannot be moved afterwards. | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| name: release | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: write | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: '1' | |
| DOTNET_NOLOGO: '1' | |
| TAG: ${{ github.ref_name }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Check that the tag matches the project version | |
| shell: pwsh | |
| run: | | |
| $version = ([xml](Get-Content src/AdoLens/AdoLens.csproj -Raw)).Project.PropertyGroup.Version | Where-Object { $_ } | Select-Object -First 1 | |
| if ("v$version" -ne $env:TAG) { throw "tag $env:TAG does not match <Version>$version</Version> in src/AdoLens/AdoLens.csproj" } | |
| "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| - name: Test | |
| run: dotnet test AdoLens.sln -c Release | |
| - name: Release notes | |
| shell: powershell | |
| run: .\release-notes.ps1 -Version $env:VERSION -OutFile dist\notes.md | |
| - name: Inno Setup | |
| shell: pwsh | |
| run: ./.github/install-inno.ps1 | |
| - name: Package | |
| shell: powershell | |
| run: .\pack.ps1 -OutDir dist -Installer | |
| # vX.Y.Z-beta.N is a test release: marked as pre-release, never "Latest". | |
| - name: Publish the release | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| $kind = if ($env:TAG -match '-') { '--prerelease' } else { '--latest' } | |
| $assets = "zip", "zip.sha256", "mcpb", "mcpb.sha256" | ForEach-Object { "dist/ado-lens-$env:VERSION.$_" } | |
| $assets += "dist/ado-lens-setup-$env:VERSION.exe", "dist/ado-lens-setup-$env:VERSION.exe.sha256" | |
| gh release create $env:TAG @assets --title "ADO Lens $env:VERSION" --notes-file dist/notes.md --verify-tag $kind |