Skip to content

Commit

Permalink
Merge pull request jquense#2084 from jquense/ci/buildRelease
Browse files Browse the repository at this point in the history
ci: Fix package and changelog updates on release
  • Loading branch information
cutterbl authored Dec 23, 2021
2 parents abd4594 + 530a0f0 commit 559d585
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '16.x'

- name: Install Dependencies
run: yarn install

# semantic release comes pre-installed in GitHub actions by default
# so only load plugins
- name: Install semantic-release extra plugins
run: yarn add @semantic-release/changelog @semantic-release/git
# test and build prior to release
- name: Unit Test & Linting
run: yarn test

- name: Build
run: yarn build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@master
id: semantic
with:
branch: master
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-big-calendar",
"version": "0.23.0",
"version": "0.38.2",
"description": "Calendar! with events",
"author": {
"name": "Jason Quense",
Expand Down Expand Up @@ -155,7 +155,5 @@
"bugs": {
"url": "https://github.com/jquense/react-big-calendar/issues"
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/jquense/react-big-calendar#readme",
"_id": "[email protected]"
"homepage": "https://github.com/jquense/react-big-calendar#readme"
}
28 changes: 28 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* https://dev.to/kouts/automated-versioning-and-package-publishing-using-github-actions-and-semantic-release-1kce
* This is what ensures that our releases update the CHANGELOG.md
* and commit those changes and a version change in the package.json
*/
module.exports = {
branches: ['master'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
},
],
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md'],
message:
'chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
],
}

0 comments on commit 559d585

Please sign in to comment.