Bump plugin and docs to 0.3.2 #8
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 | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Version tag (e.g. v0.3.0)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.compute.outputs.tag }} | |
| version: ${{ steps.compute.outputs.version }} | |
| steps: | |
| - name: Compute version from tag | |
| id: compute | |
| shell: bash | |
| run: | | |
| tag="${{ github.event.inputs.tag || github.ref_name }}" | |
| if [[ ! "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then | |
| echo "Invalid tag format: $tag" >&2 | |
| exit 1 | |
| fi | |
| version="${tag#v}" | |
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| build: | |
| needs: version | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| rid: win-x64 | |
| artifact: unityctl-win-x64.zip | |
| - os: macos-latest | |
| rid: osx-x64 | |
| artifact: unityctl-osx-x64.tar.gz | |
| - os: macos-latest | |
| rid: osx-arm64 | |
| artifact: unityctl-osx-arm64.tar.gz | |
| - os: ubuntu-latest | |
| rid: linux-x64 | |
| artifact: unityctl-linux-x64.tar.gz | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Test (unit + MCP) | |
| continue-on-error: true | |
| run: | | |
| dotnet test tests/Unityctl.Shared.Tests -c Release --verbosity normal | |
| dotnet test tests/Unityctl.Core.Tests -c Release --verbosity normal | |
| dotnet test tests/Unityctl.Cli.Tests -c Release --verbosity normal | |
| dotnet test tests/Unityctl.Mcp.Tests -c Release --verbosity normal | |
| - name: Publish | |
| run: > | |
| dotnet publish src/Unityctl.Cli/Unityctl.Cli.csproj | |
| -c Release | |
| -r ${{ matrix.rid }} | |
| -p:Version=${{ needs.version.outputs.version }} | |
| --self-contained false | |
| -o publish/${{ matrix.rid }} | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| run: Compress-Archive -Path publish/${{ matrix.rid }}/* -DestinationPath ${{ matrix.artifact }} | |
| shell: pwsh | |
| - name: Package (Unix) | |
| if: runner.os != 'Windows' | |
| run: tar -czf ${{ matrix.artifact }} -C publish/${{ matrix.rid }} . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.rid }} | |
| path: ${{ matrix.artifact }} | |
| nuget: | |
| needs: [version, build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Pack CLI | |
| run: dotnet pack src/Unityctl.Cli/Unityctl.Cli.csproj -c Release -p:Version=${{ needs.version.outputs.version }} -o nupkgs | |
| - name: Pack MCP | |
| run: dotnet pack src/Unityctl.Mcp/Unityctl.Mcp.csproj -c Release -p:Version=${{ needs.version.outputs.version }} -o nupkgs | |
| - name: Push to NuGet.org | |
| run: dotnet nuget push "nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| release: | |
| needs: [version, build, nuget] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.version.outputs.tag }} | |
| generate_release_notes: true | |
| files: artifacts/**/* |