From 3392c26059b1053515437c4101dcbd9f107f4c50 Mon Sep 17 00:00:00 2001 From: Francesco Canovai Date: Wed, 3 Jul 2024 17:03:56 +0200 Subject: [PATCH] ci: configure release-please Configure release please to release inital development versions as 0.y.z. Signed-off-by: Francesco Canovai --- .github/workflows/release-please.yml | 28 ++++++++++++++++++++++++---- .release-please-manifest.json | 3 +++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .release-please-manifest.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 15fc1c6..423db39 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -5,12 +5,32 @@ on: branches: - main +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v4 - id: release + # TODO: googleapis/release-please-action cannot sign commits yet. + # We'll use the cli until there's a fix for + # https://github.com/googleapis/release-please/issues/2280. + - uses: actions/setup-node@v4 with: - release-type: go - token: ${{ secrets.REPO_PAT }} + node-version: 20 + # TODO: remove bump-minor-pre-major when in production. It prevents + # release-please from bumping the major version on breaking changes. + # TODO: remove release-as after first release. Used to set the first + # release version, which would default to 1.0.0. Set the version + # manually also for 1.0.0. + - run: | + npx release-please release-pr \ + --token="${{ secrets.GITHUB_TOKEN }}" \ + --repo-url="${{ github.repository }}" \ + --bump-minor-pre-major=true \ + --release-as=0.1.0 \ + --signoff "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"; + npx release-please github-release \ + --token="${{ secrets.GITHUB_TOKEN }}" \ + --repo-url="${{ github.repository }}" \ diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..e18ee07 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.0" +}