Skip to content

Commit

Permalink
Add changeset action
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Skelton committed Nov 8, 2021
1 parent 2aba1a0 commit a69b913
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14.x
cache: yarn
- run: yarn install --immutable
- run: yarn tsc
- run: yarn semantic-release
- name: Create release pull request or publish to npm
uses: changesets/action@master
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"scripts": {
"lint": "eslint .",
"test": "jest",
"format": "prettier --write ."
"format": "prettier --write .",
"release": "./scripts/release.sh"
},
"peerDependencies": {
"i18next": ">=20"
Expand Down
10 changes: 10 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eo pipefail

if [[ -z "${CI}" ]]; then
echo "Releasing is only allowed from CI."
exit 1
fi

yarn tsc
yarn changeset publish

0 comments on commit a69b913

Please sign in to comment.