From b578ccaf4c6dfff0eba448e77eb544a18f453899 Mon Sep 17 00:00:00 2001 From: farhanW3 Date: Thu, 9 May 2024 15:23:08 -0700 Subject: [PATCH 1/4] Added GH Workflow to publish to NPM --- .github/workflows/npmPublish.yml | 42 ++++++++++++++++++++++++++++++++ sdk/package.json | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/npmPublish.yml diff --git a/.github/workflows/npmPublish.yml b/.github/workflows/npmPublish.yml new file mode 100644 index 000000000..499e73af1 --- /dev/null +++ b/.github/workflows/npmPublish.yml @@ -0,0 +1,42 @@ +name: Publish to npm + +on: + workflow_dispatch: + inputs: + npm_tag: + description: "Release type latest" + required: true + default: "latest" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: "main" + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "14" # Use Node.js version 14 + cache: "yarn" + + - name: Install dependencies + run: yarn install + + - name: Get version from package.json + id: package_version + run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV + + - name: Use version + run: echo "The version from package.json is $PACKAGE_VERSION" + + - name: Build + run: yarn build + + - name: Push to npm + run: npm publish ./dist --tag ${{ github.event.inputs.npm_tag }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/sdk/package.json b/sdk/package.json index 4311aaadf..e9f562e86 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@thirdweb-dev/engine", - "version": "0.0.5", + "version": "0.0.6", "main": "dist/thirdweb-dev-engine.cjs.js", "module": "dist/thirdweb-dev-engine.esm.js", "files": [ From fa4172a2af46a5288102d7f5243647dac17fe56a Mon Sep 17 00:00:00 2001 From: farhanW3 Date: Thu, 9 May 2024 15:41:19 -0700 Subject: [PATCH 2/4] updates to push from sdk --- .github/workflows/npmPublish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/npmPublish.yml b/.github/workflows/npmPublish.yml index 499e73af1..f39c211cd 100644 --- a/.github/workflows/npmPublish.yml +++ b/.github/workflows/npmPublish.yml @@ -24,19 +24,20 @@ jobs: cache: "yarn" - name: Install dependencies + working-directory: ./sdk run: yarn install - name: Get version from package.json id: package_version - run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV + run: echo "PACKAGE_VERSION=$(jq -r '.version' ./sdk/package.json)" >> $GITHUB_ENV - name: Use version - run: echo "The version from package.json is $PACKAGE_VERSION" + run: echo "SDK version is $PACKAGE_VERSION" - name: Build run: yarn build - name: Push to npm - run: npm publish ./dist --tag ${{ github.event.inputs.npm_tag }} + run: npm publish ./sdk --tag ${{ github.event.inputs.npm_tag }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 03babba5c373486cf020138482dc7a5f4cdc2099 Mon Sep 17 00:00:00 2001 From: farhanW3 Date: Thu, 9 May 2024 15:44:16 -0700 Subject: [PATCH 3/4] updated command --- .github/workflows/npmPublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npmPublish.yml b/.github/workflows/npmPublish.yml index f39c211cd..bf4756811 100644 --- a/.github/workflows/npmPublish.yml +++ b/.github/workflows/npmPublish.yml @@ -35,7 +35,7 @@ jobs: run: echo "SDK version is $PACKAGE_VERSION" - name: Build - run: yarn build + run: yarn generate:sdk - name: Push to npm run: npm publish ./sdk --tag ${{ github.event.inputs.npm_tag }} From df8dc67d087f79705037baf2d66abc8ab58282a9 Mon Sep 17 00:00:00 2001 From: farhanW3 Date: Thu, 9 May 2024 15:45:07 -0700 Subject: [PATCH 4/4] added working-dir --- .github/workflows/npmPublish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npmPublish.yml b/.github/workflows/npmPublish.yml index bf4756811..f73548e76 100644 --- a/.github/workflows/npmPublish.yml +++ b/.github/workflows/npmPublish.yml @@ -38,6 +38,7 @@ jobs: run: yarn generate:sdk - name: Push to npm - run: npm publish ./sdk --tag ${{ github.event.inputs.npm_tag }} + working-directory: ./sdk + run: npm publish --tag ${{ github.event.inputs.npm_tag }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}