Skip to content

Commit 33a8fb6

Browse files
authored
add release publish workflow (#2)
* add release publish workflow Signed-off-by: Fabian Martinez <[email protected]> * update package name Signed-off-by: Fabian Martinez <[email protected]> --------- Signed-off-by: Fabian Martinez <[email protected]>
1 parent 0203252 commit 33a8fb6

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.github/workflows/pr-validation.yaml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- v*
79
pull_request:
810
branches:
911
- main
1012

13+
env:
14+
NODE_VER: 16.14.0
15+
1116
jobs:
1217
build:
1318
runs-on: ubuntu-latest
1419

15-
env:
16-
NODE_VER: 16.14.0
17-
1820
services:
1921
# docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' --rm cgillum/durabletask-sidecar:latest start --backend Emulator
2022
durabletask-sidecar:
@@ -43,3 +45,30 @@ jobs:
4345

4446
- name: ✅ Run e2e tests
4547
run: ./scripts/test-e2e.sh
48+
49+
publish:
50+
needs: build
51+
if: startswith(github.ref, 'refs/tags/v')
52+
runs-on: ubuntu-latest
53+
# TODO environment?
54+
# environment: production
55+
steps:
56+
- name: 📥 Checkout code
57+
uses: actions/checkout@v2
58+
59+
- name: ⚙️ NodeJS - Install
60+
uses: actions/setup-node@v2
61+
with:
62+
node-version: ${{ env.NODE_VER }}
63+
registry-url: "https://registry.npmjs.org"
64+
65+
- name: Install dependencies
66+
run: npm install
67+
68+
- name: Build package
69+
run: npm run build-ci
70+
71+
- name: Publish to npm (@dapr/durabletask-js)
72+
run: npm publish build/ --access public
73+
env:
74+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@microsoft/durabletask-js",
2+
"name": "@dapr/durabletask-js",
33
"version": "0.1.0-alpha.2",
44
"description": "A Durable Task Javascript SDK compatible with Dapr Workflow and its underlying Durable Task engine",
55
"types": "./build/index.d.ts",
@@ -17,19 +17,20 @@
1717
"pretty": "prettier --list-different \"**/*.{ts,tsx,js,jsx,json,md}\"",
1818
"pretty-fix": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
1919
"prebuild": "./scripts/prebuild.sh",
20-
"build": "npm install && npm run lint && npm run pretty && ./scripts/build.sh"
20+
"build": "npm install && npm run lint && npm run pretty && ./scripts/build.sh",
21+
"build-ci": "npm run prebuild && ./scripts/build.sh"
2122
},
2223
"repository": {
2324
"type": "git",
24-
"url": "git+https://github.com/microsoft/durabletask-js.git"
25+
"url": "git+https://github.com/dapr/durabletask-js.git"
2526
},
2627
"keywords": [],
2728
"author": "",
2829
"license": "MIT",
2930
"bugs": {
30-
"url": "https://github.com/microsoft/durabletask-js/issues"
31+
"url": "https://github.com/dapr/durabletask-js/issues"
3132
},
32-
"homepage": "https://github.com/microsoft/durabletask-js#readme",
33+
"homepage": "https://github.com/dapr/durabletask-js#readme",
3334
"devDependencies": {
3435
"@swc/core": "^1.3.55",
3536
"@swc/helpers": "^0.5.1",

0 commit comments

Comments
 (0)