From 253aa7b506b6ec24652e84dd4cc0a40f80cc93e0 Mon Sep 17 00:00:00 2001 From: Dag Brattli Date: Tue, 2 Dec 2025 21:46:01 +0100 Subject: [PATCH] ci: Add release-please for automated releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add release-please GitHub Action workflow that: - Creates release PRs automatically from conventional commits - Publishes to NuGet when releases are created - Add release-please-config.json with simple release type - Add .release-please-manifest.json tracking current version - Update pyproject.toml version to 5.0.0-alpha.11 - Remove old publish.yml (functionality merged into release-please.yml) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../{publish.yml => release-please.yml} | 32 +++++++++++++++---- .release-please-manifest.json | 3 ++ pyproject.toml | 2 +- release-please-config.json | 20 ++++++++++++ 4 files changed, 50 insertions(+), 7 deletions(-) rename .github/workflows/{publish.yml => release-please.yml} (51%) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/publish.yml b/.github/workflows/release-please.yml similarity index 51% rename from .github/workflows/publish.yml rename to .github/workflows/release-please.yml index 6c73fc0..8add6af 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/release-please.yml @@ -1,11 +1,29 @@ on: - release: - types: [created] + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: Release Please -name: Publish Release jobs: - build: - name: Create Release + 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@v4 + 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: @@ -30,7 +48,9 @@ jobs: dotnet restore src - name: Pack NuGet - run: just pack-version ${GITHUB_REF##*/v} + env: + TAG_NAME: ${{ needs.release-please.outputs.tag_name }} + run: just pack-version ${TAG_NAME#v} - name: Push NuGet run: dotnet nuget push src/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..0d88db0 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "5.0.0-alpha.11" +} diff --git a/pyproject.toml b/pyproject.toml index 75053bf..6c2ffb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "Fable.Python" -version = "4.4.0" +version = "5.0.0-alpha.11" description = "Fable" authors = [{ name = "Dag Brattli", email = "dag@brattli.net" }] requires-python = ">= 3.12, < 4" diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..59c3c64 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,20 @@ +{ + "$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", + "extra-files": [ + { + "type": "toml", + "path": "pyproject.toml", + "jsonpath": "$.project.version" + } + ] + } + } +}