Skip to content

Commit 71f12b7

Browse files
committed
Update
1 parent 5f20d9f commit 71f12b7

File tree

6 files changed

+126
-36
lines changed

6 files changed

+126
-36
lines changed

.github/workflows/on-release.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release on npm
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
- package.json
9+
10+
permissions:
11+
contents: write
12+
pull-requests: read
13+
id-token: write
14+
15+
jobs:
16+
build_and_publish:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version-file: ".nvmrc"
26+
registry-url: 'https://registry.npmjs.org'
27+
scope: '@makingchatbots'
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
- name: Build
33+
run: |
34+
npm run clean
35+
npm run build
36+
37+
- id: publish
38+
name: Publish to NPM
39+
uses: JS-DevTools/npm-publish@v3
40+
with:
41+
token: ${{ secrets.NPM_TOKEN }}
42+
dry-run: false
43+
provenance: true
44+
access: public
45+
46+
- name: Post-publish
47+
if: steps.publish.outputs.type != 'none'
48+
run: |
49+
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}"
50+
51+
- name: Publish skipped
52+
if: steps.publish.outputs.type == 'none'
53+
run: |
54+
echo "Version in package.json has not changed. Skipping."
55+
exit 0
56+
57+
- name: Configure changelog
58+
if: steps.publish.outputs.type != 'none'
59+
run: |
60+
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
61+
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
62+
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
63+
64+
- name: Generate changelog
65+
if: steps.publish.outputs.type != 'none'
66+
id: github_release
67+
uses: mikepenz/[email protected]
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
with:
71+
fromTag: "${{ env.last_tag }}"
72+
toTag: ${{ github.ref }}
73+
commitMode: true
74+
configuration: changelog_config.json
75+
76+
- name: Create release
77+
if: steps.publish.outputs.type != 'none'
78+
id: create_release
79+
uses: actions/create-release@v1
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
with:
83+
tag_name: v${{ steps.publish.outputs.version }}
84+
release_name: v${{ steps.publish.outputs.version }}
85+
commitish: ${{ github.ref }}
86+
body: ${{ steps.github_release.outputs.changelog }}
87+
draft: false
88+
prerelease: false
89+
90+
- name: Build .dxt file
91+
if: steps.publish.outputs.type != 'none'
92+
run: npm run package:dxt
93+
94+
- name: Upload .dxt to GitHub release
95+
if: steps.publish.outputs.type != 'none'
96+
uses: softprops/action-gh-release@v1
97+
with:
98+
tag_name: v${{ steps.publish.outputs.version }}
99+
files: |
100+
genesys-cloud-mcp-server.dxt
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
name: On Push
1+
name: test
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
413

514
jobs:
615
lint:
716
runs-on: ubuntu-latest
817
steps:
918
- uses: actions/checkout@v4
10-
- name: Setup Node
11-
uses: actions/setup-node@v4
19+
- uses: actions/setup-node@v4
1220
with:
13-
node-version: 18.x
21+
node-version-file: ".nvmrc"
1422
- run: npm install
1523
- run: npm run lint
1624
env:
@@ -20,10 +28,9 @@ jobs:
2028
runs-on: ubuntu-latest
2129
steps:
2230
- uses: actions/checkout@v4
23-
- name: Setup Node
24-
uses: actions/setup-node@v4
31+
- uses: actions/setup-node@v4
2532
with:
26-
node-version: 18.x
33+
node-version-file: ".nvmrc"
2734
- run: npm install
2835
- run: npm run build
2936
- run: npm run test
@@ -32,10 +39,9 @@ jobs:
3239
runs-on: ubuntu-latest
3340
steps:
3441
- uses: actions/checkout@v4
35-
- name: Setup Node
36-
uses: actions/setup-node@v4
42+
- uses: actions/setup-node@v4
3743
with:
38-
node-version: 18.x
44+
node-version-file: ".nvmrc"
3945
- run: npm install
4046
- run: npm run build
4147
- run: npm run build:docs
@@ -44,10 +50,9 @@ jobs:
4450
runs-on: ubuntu-latest
4551
steps:
4652
- uses: actions/checkout@v4
47-
- name: Setup Node
48-
uses: actions/setup-node@v4
53+
- uses: actions/setup-node@v4
4954
with:
50-
node-version: 18.x
55+
node-version-file: ".nvmrc"
5156
- run: npm install
5257
- run: npm run build
5358
- run: cd examples/api && npm run test:js

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
],
1313
"scripts": {
1414
"test": "npm test -w packages/genesys-cloud-chatbot-tester -w packages/genesys-cloud-chatbot-tester-cli",
15+
"clean": "npm run clean --workspaces --if-present",
1516
"lint": "npm run lint --workspaces --if-present",
1617
"lint:fix": "npm run lint:fix --workspaces --if-present",
1718
"build": "npm run build --workspaces --if-present",

packages/genesys-cloud-chatbot-tester-cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
],
1818
"author": "Lucas Woodward",
1919
"scripts": {
20-
"build": "rm -rf ./lib && tsc -p tsconfig.json",
20+
"clean": "rm -rf ./lib",
21+
"build": "npm run clean && tsc -p tsconfig.json",
2122
"test": "vitest run",
2223
"lint": "eslint . --ignore-pattern 'lib/*'",
2324
"lint:fix": "eslint . --ignore-pattern 'lib/*' --fix",

packages/genesys-cloud-chatbot-tester/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
],
1818
"author": "Lucas Woodward",
1919
"scripts": {
20-
"build": "rm -rf ./lib && tsc -p tsconfig.json",
20+
"clean": "rm -rf ./lib",
21+
"build": "npm run clean && tsc -p tsconfig.json",
2122
"build:readme": "cd ../.. && build-readme ./packages/genesys-cloud-chatbot-tester/README.md https://github.com/makingchatbots/genesys-cloud-chatbot-tester/tree/main",
2223
"test": "vitest run",
2324
"lint": "eslint . --ignore-pattern 'lib/*'",

0 commit comments

Comments
 (0)