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" + } + ] + } + } +}