From 22d2b5f8522a4a071271f86c6b448c12a3bc9eff Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Tue, 2 May 2023 23:25:58 +0100 Subject: [PATCH] chore(replease): add release-please --- .github/workflows/ci.yml | 20 +++++++++++++++++--- .release-please-manifest.json | 3 +++ release-please-config.json | 14 ++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2a059d..f1659f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,20 @@ name: CI on: push jobs: + release-please: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + outputs: + release_created: ${{ steps.release-please.outputs.release_created }} + tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0 + version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0 + all: ${{ toJSON(steps.release-please.outputs) }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release-please + with: + command: manifest + lint: runs-on: ubuntu-latest steps: @@ -71,8 +85,8 @@ jobs: release: runs-on: ubuntu-latest - needs: [lint, test] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + needs: [test, release-please] + if: needs.release-please.outputs.release_created steps: - uses: actions/checkout@master @@ -82,7 +96,7 @@ jobs: ruby-version: 3.1 - name: Export version from tag name - run: echo ${GITHUB_REF/refs\/tags\//} > VERSION + run: echo ${{ needs.release-please.outputs.version }} > VERSION - name: Build Gem run: gem build *.gemspec diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..9dc6cef --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.4.0" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..13dc90e --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,14 @@ +{ + "bootstrap-sha": "23c79175d75dc85cf0b059d9b33d8da8928e0384", + "packages": { + ".": { + "release-type": "ruby", + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "draft": false, + "prerelease": false + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +}