From 7225db6186ec068f477b38e1459596447c7c5a0c Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Tue, 18 Jan 2022 15:53:33 -0600 Subject: [PATCH] Fix version and publishing --- .github/workflows/build.yml | 3 ++- package.json | 3 +-- scripts/release.sh | 2 +- scripts/version.sh | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 scripts/version.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 133bc2e..deabcec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} diff --git a/package.json b/package.json index fd6358a..8b0c85f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/release.sh b/scripts/release.sh index 55f5b61..ee4bf69 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -6,5 +6,5 @@ if [[ -z "${CI}" ]]; then exit 1 fi -yarn tsc -p tsconfig.build.json +yarn ts yarn changeset publish diff --git a/scripts/version.sh b/scripts/version.sh new file mode 100755 index 0000000..6f27f00 --- /dev/null +++ b/scripts/version.sh @@ -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