From c3beb62b1f16fddc0bffe3a090e160626c5a31b5 Mon Sep 17 00:00:00 2001 From: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com> Date: Wed, 28 Jul 2021 13:29:59 +0800 Subject: [PATCH] fixed version:set (#275) --- .github/workflows/release-publish.yml | 4 ++-- package.json | 2 +- packages/whale-api-client/package.json | 4 ++-- packages/whale-api-client/src/version.ts | 3 --- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 2065b2810..a7a78900f 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -28,7 +28,7 @@ jobs: result-encoding: string - run: npm ci - - run: npm run publish:version ${{ steps.version.outputs.result }} + - run: npm run version:set ${{ steps.version.outputs.result }} - name: Set up QEMU uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 @@ -79,7 +79,7 @@ jobs: result-encoding: string - run: npm ci - - run: npm run publish:version ${{ steps.version.outputs.result }} + - run: npm run version:set ${{ steps.version.outputs.result }} - run: npm run packages:build - name: Publish Next diff --git a/package.json b/package.json index ff874f80c..2a6865ec9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test": "jest", "test:watch": "jest --watch", "test:ci": "jest --ci --coverage --maxWorkers=4", - "publish:version": "lerna version $1 --yes --no-push --no-git-tag-version", + "version:set": "lerna version $1 --yes --no-push --no-git-tag-version", "packages:build": "lerna run --no-private build", "packages:publish:next": "lerna exec --no-private -- npm publish --tag next --access public", "packages:publish:latest": "lerna exec --no-private -- npm publish --tag latest --access public" diff --git a/packages/whale-api-client/package.json b/packages/whale-api-client/package.json index deffb798a..affe0d9ba 100644 --- a/packages/whale-api-client/package.json +++ b/packages/whale-api-client/package.json @@ -37,8 +37,8 @@ "dist" ], "scripts": { - "build": "tsc", - "prepack": "node -p \"'export default \\'v' + require('./package.json').version.replace(/\\.\\d+$/, '') + '\\''\" > src/version.ts" + "build": "npm run version.ts && tsc", + "version.ts": "node -p \"'export default \\'v' + require('./package.json').version.replace(/\\.\\d+$/, '') + '\\''\" > src/version.ts" }, "dependencies": { "@defichain/jellyfish-api-core": ">=0.30.0", diff --git a/packages/whale-api-client/src/version.ts b/packages/whale-api-client/src/version.ts index 9018b1b13..902f1da8c 100644 --- a/packages/whale-api-client/src/version.ts +++ b/packages/whale-api-client/src/version.ts @@ -1,4 +1 @@ -/** - * Automatically set by script: "prepack", automated at CI - */ export default 'v0.0'