From 7108038ef97d1df836edc213b0d28582a5b98125 Mon Sep 17 00:00:00 2001 From: Grant Zukel <80433392+gzukel@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:04:38 -0700 Subject: [PATCH] ci: Finalize typescript NPM package publish on release creation. (#1548) * ci: add typescript publishing --- .github/workflows/publish-typescript.yaml | 16 ++++++++++------ scripts/protoc-gen-typescript.sh | 2 +- typescript/package.json | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-typescript.yaml b/.github/workflows/publish-typescript.yaml index a5906d5047..890f867d8b 100644 --- a/.github/workflows/publish-typescript.yaml +++ b/.github/workflows/publish-typescript.yaml @@ -16,16 +16,20 @@ jobs: node-version: '20.x' registry-url: 'https://registry.npmjs.org' + - name: Install buf + run: | + curl -sSL https://github.com/bufbuild/buf/releases/download/v1.28.1/buf-Linux-x86_64 -o /usr/local/bin/buf + chmod +x /usr/local/bin/buf + + - name: Generate + run: | + make typescript + - name: Set Version working-directory: typescript run: | - version=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"') + version=$(cat ../app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"') npm version ${version} - sed -i 's/@zetachain\/blockchain-types/@zetachain\/node-types/' package.json - - - name: Install dependencies and build 🔧 - working-directory: typescript - run: npm ci && npm run build - name: Publish package on NPM 📦 run: npm publish diff --git a/scripts/protoc-gen-typescript.sh b/scripts/protoc-gen-typescript.sh index 526d4773da..e56c951de1 100755 --- a/scripts/protoc-gen-typescript.sh +++ b/scripts/protoc-gen-typescript.sh @@ -8,7 +8,7 @@ rm -rf $DIR cat < $DIR/package.json { - "name": "@zetachain/blockchain-types", + "name": "@zetachain/node-types", "version": "0.0.0-set-on-publish", "description": "", "main": "", diff --git a/typescript/package.json b/typescript/package.json index 369d5cbb82..31e60016e1 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,5 +1,5 @@ { - "name": "@zetachain/blockchain-types", + "name": "@zetachain/node-types", "version": "0.0.0-set-on-publish", "description": "", "main": "",