From 4a5e0482272f05a832b0efb6d7e50fa43626df20 Mon Sep 17 00:00:00 2001 From: Dag Brattli Date: Mon, 27 Apr 2026 21:21:57 +0200 Subject: [PATCH] ci: replace release-please with EasyBuild.ShipIt Switches release automation from googleapis/release-please to EasyBuild.ShipIt, matching the setup used in Fable.Python. ShipIt opens a "chore: release X.Y.Z" PR on each push to master; merging that PR triggers the publish job which packs and pushes both Feliz.ViewEngine and Feliz.Bulma.ViewEngine to NuGet. Co-Authored-By: Claude Opus 4.7 (1M context) --- .config/dotnet-tools.json | 7 ++++ .github/workflows/publish.yml | 59 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 55 -------------------------- .release-please-manifest.json | 3 -- CHANGELOG.md | 5 +++ justfile | 22 +++++++++-- release-please-config.json | 13 ------ 7 files changed, 89 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release-please.yml delete mode 100644 .release-please-manifest.json delete mode 100644 release-please-config.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3d9abb1..764776a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -8,6 +8,13 @@ "paket" ], "rollForward": false + }, + "easybuild.shipit": { + "version": "3.0.0", + "commands": [ + "shipit" + ], + "rollForward": false } } } \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..90f1085 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,59 @@ +name: Publish NuGet + +on: + push: + branches: [master] + +permissions: + contents: write + pull-requests: write + +jobs: + shipit-pr: + name: ShipIt - Pull Request + runs-on: ubuntu-latest + if: "!startsWith(github.event.head_commit.message, 'chore: release ')" + timeout-minutes: 10 + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 9.0.x + + - name: Install tools + run: dotnet tool restore + + - name: ShipIt (Pull Request) + run: dotnet shipit --allow-branch master + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Release + runs-on: ubuntu-latest + timeout-minutes: 10 + if: "startsWith(github.event.head_commit.message, 'chore: release ')" + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 9.0.x + + - name: Install just + uses: extractions/setup-just@v4 + + - name: Restore dependencies + run: just restore + + - name: Build, pack and push + run: just release + env: + NUGET_KEY: ${{ secrets.NUGET_API_KEY }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 85e21a1..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,55 +0,0 @@ -on: - push: - branches: - - master - -permissions: - contents: write - pull-requests: write - -name: Release Please - -jobs: - release-please: - runs-on: ubuntu-latest - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - steps: - - uses: googleapis/release-please-action@v5 - id: release - with: - token: ${{ secrets.GITHUB_TOKEN }} - - publish: - needs: release-please - if: ${{ needs.release-please.outputs.release_created }} - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 9.0.x - - - name: Install just - uses: extractions/setup-just@v4 - - - name: Restore dependencies - run: just restore - - - name: Pack NuGet - env: - TAG_NAME: ${{ needs.release-please.outputs.tag_name }} - run: just pack-version ${TAG_NAME#v} - - - name: Push Feliz.ViewEngine NuGet - run: dotnet nuget push src/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} - continue-on-error: false - - - name: Push Feliz.Bulma.ViewEngine NuGet - run: dotnet nuget push Feliz.Bulma.ViewEngine/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} - continue-on-error: false diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index 0db4c77..0000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "1.0.3" -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e3e61a..473222a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +--- +last_commit_released: 304800ecb2ab9c78f6062472f4cb2f76316bfaff +name: Feliz.ViewEngine +--- + # Changelog All notable changes to this project will be documented in this file. diff --git a/justfile b/justfile index 2a2bd90..184b54d 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,8 @@ # Feliz.ViewEngine build commands # Install just: https://github.com/casey/just +set dotenv-load + src_path := "src" test_path := "test" bulma_path := "Feliz.Bulma.ViewEngine" @@ -35,13 +37,25 @@ test: # Build and run tests check: build test -# Create NuGet packages +# Create NuGet packages with version from CHANGELOG.md pack: - dotnet pack -c Release + #!/usr/bin/env bash + set -euo pipefail + VERSION=$(grep -m1 '^## ' CHANGELOG.md | sed 's/^## \[\?\([^] ]*\).*/\1/') + dotnet pack -c Release -p:PackageVersion=$VERSION -p:InformationalVersion=$VERSION -# Create NuGet packages with specific version (used in CI) +# Create NuGet packages with specific version pack-version version: - dotnet pack -c Release -p:PackageVersion={{version}} + dotnet pack -c Release -p:PackageVersion={{version}} -p:InformationalVersion={{version}} + +# Release: pack and push both packages to NuGet (used in CI) +release: pack + dotnet nuget push '{{src_path}}/bin/Release/*.nupkg' -s https://api.nuget.org/v3/index.json -k $NUGET_KEY + dotnet nuget push '{{bulma_path}}/bin/Release/*.nupkg' -s https://api.nuget.org/v3/index.json -k $NUGET_KEY + +# Run EasyBuild.ShipIt for release management +shipit *args: + dotnet shipit {{args}} # Full setup and test setup: restore build test diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index ba51ca6..0000000 --- a/release-please-config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", - "packages": { - ".": { - "release-type": "simple", - "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": true, - "include-component-in-tag": false, - "include-v-in-tag": true, - "changelog-path": "CHANGELOG.md" - } - } -}