Skip to content

Commit

Permalink
ci: Finalize typescript NPM package publish on release creation. (#1548)
Browse files Browse the repository at this point in the history
* ci: add typescript publishing
  • Loading branch information
gzukel authored Jan 10, 2024
1 parent 0fe3dc5 commit 7108038
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/publish-typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/protoc-gen-typescript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm -rf $DIR

cat <<EOL > $DIR/package.json
{
"name": "@zetachain/blockchain-types",
"name": "@zetachain/node-types",
"version": "0.0.0-set-on-publish",
"description": "",
"main": "",
Expand Down
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@zetachain/blockchain-types",
"name": "@zetachain/node-types",
"version": "0.0.0-set-on-publish",
"description": "",
"main": "",
Expand Down

0 comments on commit 7108038

Please sign in to comment.