Skip to content

Commit

Permalink
Fix version and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Skelton committed Jan 18, 2022
1 parent addf402 commit 7225db6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ jobs:
id: changesets
uses: changesets/action@master
with:
publish: yarn release
publish: ./scripts/release.sh
version: ./scripts/version.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"format": "prettier --write .",
"lint": "eslint .",
"test": "jest",
"ts": "tsc -b",
"release": "./scripts/release.sh"
"ts": "tsc -b"
},
"devDependencies": {
"@babel/core": "^7.16.7",
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ if [[ -z "${CI}" ]]; then
exit 1
fi

yarn tsc -p tsconfig.build.json
yarn ts
yarn changeset publish
15 changes: 15 additions & 0 deletions scripts/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -eo pipefail

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

# Update changelogs and manifests
yarn changeset version

# yarn.lock stores dependent package versions, so we need
# to update it before committing or CI will fail due to
# yarn.lock being out of date.
yarn

0 comments on commit 7225db6

Please sign in to comment.