v0.25.0 #12
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: Build and Publish .NET Tool | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-pack: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Extract version (without v) | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| # Extract version from release tag (remove any 'v' prefix) | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION=${VERSION#v} # Remove 'v' prefix if present | |
| else | |
| VERSION="${{ github.event.inputs.version }}" | |
| VERSION=${VERSION#v} # Remove 'v' prefix if present | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Syncing version: $VERSION" | |
| - name: Build and Pack as .NET tool | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| runCmd: | | |
| dotnet cake --target Pack-DotNetTool --package-version ${{ steps.version.outputs.version }} | |
| - name: Publish to NuGet (optional) | |
| run: dotnet nuget push ./artifacts/nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |