Skip to content

Commit 6e8b094

Browse files
dbrattliclaude
andauthored
ci: Add release-please for automated releases (#150)
- 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 <noreply@anthropic.com>
1 parent 80d384c commit 6e8b094

File tree

4 files changed

+50
-7
lines changed

4 files changed

+50
-7
lines changed
Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
on:
2-
release:
3-
types: [created]
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: Release Please
411

5-
name: Publish Release
612
jobs:
7-
build:
8-
name: Create Release
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
publish:
25+
needs: release-please
26+
if: ${{ needs.release-please.outputs.release_created }}
927
runs-on: ubuntu-latest
1028
timeout-minutes: 10
1129
steps:
@@ -30,7 +48,9 @@ jobs:
3048
dotnet restore src
3149
3250
- name: Pack NuGet
33-
run: just pack-version ${GITHUB_REF##*/v}
51+
env:
52+
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}
53+
run: just pack-version ${TAG_NAME#v}
3454

3555
- name: Push NuGet
3656
run: dotnet nuget push src/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "5.0.0-alpha.11"
3+
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "Fable.Python"
3-
version = "4.4.0"
3+
version = "5.0.0-alpha.11"
44
description = "Fable"
55
authors = [{ name = "Dag Brattli", email = "dag@brattli.net" }]
66
requires-python = ">= 3.12, < 4"

release-please-config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "simple",
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": true,
8+
"include-component-in-tag": false,
9+
"include-v-in-tag": true,
10+
"changelog-path": "CHANGELOG.md",
11+
"extra-files": [
12+
{
13+
"type": "toml",
14+
"path": "pyproject.toml",
15+
"jsonpath": "$.project.version"
16+
}
17+
]
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)