Skip to content

Commit

Permalink
ci(release): setup release-please to automate changelog and releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jimeh committed Jul 25, 2023
1 parent 758a94a commit 0e27ef2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.3.1"
}
14 changes: 14 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"bootstrap-sha": "3cf7a0c19e1313e2449e62d2a2a9b5c221c920fa",
"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"
}
24 changes: 19 additions & 5 deletions .github/workflows/commit.yaml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Commit
on: push
name: CI
on: [push]

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -34,18 +35,31 @@ jobs:
- name: Run tests
run: bundle exec rspec

release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
version: ${{ steps.release-please.outputs.version }}
steps:
- uses: krystal/release-please-manifest-action@v1
id: release-please
with:
app-id: ${{ vars.RELEASE_PLEASE_GITHUB_APP_ID }}
private-key: ${{ secrets.RELEASE_PLEASE_GITHUB_APP_PRIVATE_KEY }}

release:
runs-on: ubuntu-latest
needs: [lint, test]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [lint, test, release-please]
if: needs.release-please.outputs.release_created
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
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
- name: Setup credentials
Expand Down
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ This file contains all the latest changes and updates to Klogger.

### Features

- add group with ID method ([0bd5e5](https://github.com/krystal/klogger/commit/0bd5e590b8ffe055de98403d8ddf9d597dba5208))
* add group with ID method ([0bd5e5](https://github.com/krystal/klogger/commit/0bd5e590b8ffe055de98403d8ddf9d597dba5208))

## 1.2.0

### Features

- change default formatter to 'go' ([e484ab](https://github.com/krystal/klogger/commit/e484ab39eb7fb6d1a6722d4e55227d00d703ba6e))
- support for global-level groups ([9964b0](https://github.com/krystal/klogger/commit/9964b0818dbcb81e3ed0d488cb761d9a16ed59d1))
- support for loggers without names ([4d89c8](https://github.com/krystal/klogger/commit/4d89c8fc84f16963e09c94c60c22fca24d0811c9))
* change default formatter to 'go' ([e484ab](https://github.com/krystal/klogger/commit/e484ab39eb7fb6d1a6722d4e55227d00d703ba6e))
* support for global-level groups ([9964b0](https://github.com/krystal/klogger/commit/9964b0818dbcb81e3ed0d488cb761d9a16ed59d1))
* support for loggers without names ([4d89c8](https://github.com/krystal/klogger/commit/4d89c8fc84f16963e09c94c60c22fca24d0811c9))

## 1.1.0

### Features

- group ids ([d7beda](https://github.com/krystal/klogger/commit/d7bedad43b2a2f508322d4f3d9e3bd82e22e9ccc))
* group ids ([d7beda](https://github.com/krystal/klogger/commit/d7bedad43b2a2f508322d4f3d9e3bd82e22e9ccc))

### Bug Fixes

- thread-safety for silencing ([9c19a4](https://github.com/krystal/klogger/commit/9c19a4a5c33c5790c55ddcb25fc3aa758b86dadd))
* thread-safety for silencing ([9c19a4](https://github.com/krystal/klogger/commit/9c19a4a5c33c5790c55ddcb25fc3aa758b86dadd))

## 1.0.1

### Bug Fixes

- ensure support for logging the result of a block ([3f7e95](https://github.com/krystal/klogger/commit/3f7e9517f19e3e80ad3987d71c29e23e3dc2cfca))
- thread safety for groups ([e2f0a9](https://github.com/krystal/klogger/commit/e2f0a98b019998ebb18ddd8e48b5ee267e08878a))
* ensure support for logging the result of a block ([3f7e95](https://github.com/krystal/klogger/commit/3f7e9517f19e3e80ad3987d71c29e23e3dc2cfca))
* thread safety for groups ([e2f0a9](https://github.com/krystal/klogger/commit/e2f0a98b019998ebb18ddd8e48b5ee267e08878a))

## 1.0.0

Initial release
* Initial release ([450682](https://github.com/krystal/klogger/commit/450682ef064a0ea58981a0869830fe96b53a4185))

0 comments on commit 0e27ef2

Please sign in to comment.