Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/workflows/on-release.yml

This file was deleted.

129 changes: 129 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Release on npm

on:
push:
branches:
- "main"
paths:
- packages/**/package.json

permissions:
contents: write
pull-requests: read
id-token: write

jobs:
build_and_publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: 'https://registry.npmjs.org'
scope: '@makingchatbots'

- name: Install dependencies
run: npm install

- name: Build
run: |
npm run clean
npm run build

- id: publish_sdk
name: Publish genesys-cloud-chatbot-tester
uses: JS-DevTools/npm-publish@v3
with:
package: packages/genesys-cloud-chatbot-tester
token: ${{ secrets.NPM_TOKEN }}
dry-run: false
provenance: true
access: public

- id: publish_cli
name: Publish genesys-cloud-chatbot-tester-cli
uses: JS-DevTools/npm-publish@v3
with:
package: packages/genesys-cloud-chatbot-tester-cli
token: ${{ secrets.NPM_TOKEN }}
dry-run: false
provenance: true
access: public

- name: Post-publish genesys-cloud-chatbot-tester
if: steps.publish_sdk.outputs.type != 'none'
run: echo "Published genesys-cloud-chatbot-tester ${{ steps.publish_sdk.outputs.version }}"

- name: Post-publish genesys-cloud-chatbot-tester-cli
if: steps.publish_cli.outputs.type != 'none'
run: echo "Published genesys-cloud-chatbot-tester-cli ${{ steps.publish_cli.outputs.version }}"

- name: Configure changelog for genesys-cloud-chatbot-tester
if: steps.publish_sdk.outputs.type != 'none'
run: |
cat <<'EOF' > changelog_config.json
{"categories": [], "template": "## Commits:\n\n${{UNCATEGORIZED}}", "pr_template": "- ${{MERGE_SHA}} ${{TITLE}}"}
EOF
echo "last_tag=$(git describe --tags --match \"genesys-cloud-chatbot-tester-v*\" --abbrev=0 || echo)" >> $GITHUB_ENV

- name: Generate changelog for genesys-cloud-chatbot-tester
if: steps.publish_sdk.outputs.type != 'none'
id: changelog_tester
uses: mikepenz/release-changelog-builder-action@v2.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.ref }}
commitMode: true
configuration: changelog_config.json

- name: Create release for genesys-cloud-chatbot-tester
if: steps.publish_sdk.outputs.type != 'none'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: genesys-cloud-chatbot-tester-v${{ steps.publish_sdk.outputs.version }}
release_name: genesys-cloud-chatbot-tester-v${{ steps.publish_sdk.outputs.version }}
commitish: ${{ github.ref }}
body: ${{ steps.changelog_tester.outputs.changelog }}
draft: false
prerelease: false

- name: Configure changelog for genesys-cloud-chatbot-tester-cli
if: steps.publish_cli.outputs.type != 'none'
run: |
cat <<'EOF' > changelog_config.json
{"categories": [], "template": "## Commits:\n\n${{UNCATEGORIZED}}", "pr_template": "- ${{MERGE_SHA}} ${{TITLE}}"}
EOF
echo "last_tag=$(git describe --tags --match \"genesys-cloud-chatbot-tester-cli-v*\" --abbrev=0 || echo)" >> $GITHUB_ENV

- name: Generate changelog for genesys-cloud-chatbot-tester-cli
if: steps.publish_cli.outputs.type != 'none'
id: changelog_cli
uses: mikepenz/release-changelog-builder-action@v2.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.ref }}
commitMode: true
configuration: changelog_config.json

- name: Create release for genesys-cloud-chatbot-tester-cli
if: steps.publish_cli.outputs.type != 'none'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: genesys-cloud-chatbot-tester-cli-v${{ steps.publish_cli.outputs.version }}
release_name: genesys-cloud-chatbot-tester-cli-v${{ steps.publish_cli.outputs.version }}
commitish: ${{ github.ref }}
body: ${{ steps.changelog_cli.outputs.changelog }}
draft: false
prerelease: false
33 changes: 19 additions & 14 deletions .github/workflows/on-push.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: On Push
name: test

on: [push]
on:
push:
branches:
- "main"
pull_request:
branches:
- main

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version-file: ".nvmrc"
- run: npm install
- run: npm run lint
env:
Expand All @@ -20,10 +28,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version-file: ".nvmrc"
- run: npm install
- run: npm run build
- run: npm run test
Expand All @@ -32,10 +39,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version-file: ".nvmrc"
- run: npm install
- run: npm run build
- run: npm run build:docs
Expand All @@ -44,10 +50,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version-file: ".nvmrc"
- run: npm install
- run: npm run build
- run: cd examples/api && npm run test:js
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"scripts": {
"test": "npm test -w packages/genesys-cloud-chatbot-tester -w packages/genesys-cloud-chatbot-tester-cli",
"clean": "npm run clean --workspaces --if-present",
"lint": "npm run lint --workspaces --if-present",
"lint:fix": "npm run lint:fix --workspaces --if-present",
"build": "npm run build --workspaces --if-present",
Expand Down
3 changes: 2 additions & 1 deletion packages/genesys-cloud-chatbot-tester-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
],
"author": "Lucas Woodward",
"scripts": {
"build": "rm -rf ./lib && tsc -p tsconfig.json",
"clean": "rm -rf ./lib",
"build": "npm run clean && tsc -p tsconfig.json",
"test": "vitest run",
"lint": "eslint . --ignore-pattern 'lib/*'",
"lint:fix": "eslint . --ignore-pattern 'lib/*' --fix",
Expand Down
3 changes: 2 additions & 1 deletion packages/genesys-cloud-chatbot-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
],
"author": "Lucas Woodward",
"scripts": {
"build": "rm -rf ./lib && tsc -p tsconfig.json",
"clean": "rm -rf ./lib",
"build": "npm run clean && tsc -p tsconfig.json",
"build:readme": "cd ../.. && build-readme ./packages/genesys-cloud-chatbot-tester/README.md https://github.com/makingchatbots/genesys-cloud-chatbot-tester/tree/main",
"test": "vitest run",
"lint": "eslint . --ignore-pattern 'lib/*'",
Expand Down