Skip to content

Commit a8115ab

Browse files
authored
Added GH Workflow to publish to NPM (#514)
* Added GH Workflow to publish to NPM * updates to push from sdk * updated command * added working-dir
1 parent b83f428 commit a8115ab

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/npmPublish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to npm
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
npm_tag:
7+
description: "Release type latest"
8+
required: true
9+
default: "latest"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
with:
18+
ref: "main"
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: "14" # Use Node.js version 14
24+
cache: "yarn"
25+
26+
- name: Install dependencies
27+
working-directory: ./sdk
28+
run: yarn install
29+
30+
- name: Get version from package.json
31+
id: package_version
32+
run: echo "PACKAGE_VERSION=$(jq -r '.version' ./sdk/package.json)" >> $GITHUB_ENV
33+
34+
- name: Use version
35+
run: echo "SDK version is $PACKAGE_VERSION"
36+
37+
- name: Build
38+
run: yarn generate:sdk
39+
40+
- name: Push to npm
41+
working-directory: ./sdk
42+
run: npm publish --tag ${{ github.event.inputs.npm_tag }}
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thirdweb-dev/engine",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"main": "dist/thirdweb-dev-engine.cjs.js",
55
"module": "dist/thirdweb-dev-engine.esm.js",
66
"files": [

0 commit comments

Comments
 (0)