fix: Exclude Lifter.Maui from GitHub Actions workflow #9
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
| # This workflow builds, tests, publishes NuGet packages, and updates documentation | |
| name: Publish to NuGet and Update Docs | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Triggers only on version tags like v1.1.0 | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g., 1.1.0)' | |
| required: true | |
| jobs: | |
| build-test-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required for creating GitHub Release and pushing to gh-pages | |
| steps: | |
| # 1. Checkout code | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # 2. Setup .NET SDK 9.x (supports both net8.0 and net9.0 targets) | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| # 3. Extract version from tag or manual input | |
| - name: Extract version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| fi | |
| # 4. Restore workloads (only for Blazor wasm-tools) | |
| - name: Restore workloads | |
| run: dotnet workload restore Lifter.Blazor/Lifter.Blazor.csproj | |
| # 5. Restore dependencies (excluding Lifter.Maui) | |
| - name: Restore dependencies | |
| run: | | |
| dotnet restore Lifter.Core/Lifter.Core.csproj | |
| dotnet restore Lifter.Avalonia/Lifter.Avalonia.csproj | |
| dotnet restore Lifter.Blazor/Lifter.Blazor.csproj | |
| # 6. Build in Release configuration (excluding Lifter.Maui) | |
| - name: Build | |
| run: | | |
| dotnet build Lifter.Core/Lifter.Core.csproj --no-restore --configuration Release | |
| dotnet build Lifter.Avalonia/Lifter.Avalonia.csproj --no-restore --configuration Release | |
| dotnet build Lifter.Blazor/Lifter.Blazor.csproj --no-restore --configuration Release | |
| # 7. Run tests (if any) | |
| - name: Run tests | |
| run: echo "No tests configured yet" | |
| # --- Publishing (only on tag push or manual workflow) --- | |
| # 8. Pack NuGet packages (excluding Lifter.Maui) | |
| - name: Pack NuGet packages | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | |
| run: | | |
| dotnet pack Lifter.Core/Lifter.Core.csproj --no-build --configuration Release --output ./packages | |
| dotnet pack Lifter.Avalonia/Lifter.Avalonia.csproj --no-build --configuration Release --output ./packages | |
| dotnet pack Lifter.Blazor/Lifter.Blazor.csproj --no-build --configuration Release --output ./packages | |
| # 8. Publish to NuGet | |
| - name: Publish to NuGet | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | |
| run: dotnet nuget push "./packages/*.nupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| # 9. Create versioned documentation | |
| - name: Create versioned documentation | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | |
| run: | | |
| VERSION=${{ steps.version.outputs.VERSION }} | |
| MAJOR_MINOR=$(echo $VERSION | cut -d. -f1,2) | |
| # Create versioned docs directory | |
| mkdir -p docs/v${MAJOR_MINOR} | |
| # Copy latest docs to versioned directory | |
| cp -r docs/latest/* docs/v${MAJOR_MINOR}/ | |
| # Update version placeholders | |
| find docs/v${MAJOR_MINOR} -type f -name "*.md" -exec sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" {} \; | |
| find docs/v${MAJOR_MINOR} -type f -name "*.md" -exec sed -i "s|/latest/|/v${MAJOR_MINOR}/|g" {} \; | |
| # 10. Deploy documentation to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: docs | |
| clean: false | |
| commit-message: "docs: update documentation for v${{ steps.version.outputs.VERSION }}" | |
| # 11. Create GitHub Release | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ./packages/*.nupkg | |
| generate_release_notes: true |