Skip to content

Commit e553126

Browse files
committed
Update flow
1 parent 71f12b7 commit e553126

File tree

1 file changed

+62
-35
lines changed

1 file changed

+62
-35
lines changed

.github/workflows/release.yml

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- "main"
77
paths:
8-
- package.json
8+
- packages/**/package.json
99

1010
permissions:
1111
contents: write
@@ -34,36 +34,45 @@ jobs:
3434
npm run clean
3535
npm run build
3636
37-
- id: publish
38-
name: Publish to NPM
37+
- id: publish_sdk
38+
name: Publish genesys-cloud-chatbot-tester
3939
uses: JS-DevTools/npm-publish@v3
4040
with:
41+
package: packages/genesys-cloud-chatbot-tester
4142
token: ${{ secrets.NPM_TOKEN }}
4243
dry-run: false
4344
provenance: true
4445
access: public
4546

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 }}"
47+
- id: publish_cli
48+
name: Publish genesys-cloud-chatbot-tester-cli
49+
uses: JS-DevTools/npm-publish@v3
50+
with:
51+
package: packages/genesys-cloud-chatbot-tester-cli
52+
token: ${{ secrets.NPM_TOKEN }}
53+
dry-run: false
54+
provenance: true
55+
access: public
5056

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
57+
- name: Post-publish genesys-cloud-chatbot-tester
58+
if: steps.publish_sdk.outputs.type != 'none'
59+
run: echo "Published genesys-cloud-chatbot-tester ${{ steps.publish_sdk.outputs.version }}"
60+
61+
- name: Post-publish genesys-cloud-chatbot-tester-cli
62+
if: steps.publish_cli.outputs.type != 'none'
63+
run: echo "Published genesys-cloud-chatbot-tester-cli ${{ steps.publish_cli.outputs.version }}"
5664

57-
- name: Configure changelog
58-
if: steps.publish.outputs.type != 'none'
65+
- name: Configure changelog for genesys-cloud-chatbot-tester
66+
if: steps.publish_sdk.outputs.type != 'none'
5967
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
68+
cat <<'EOF' > changelog_config.json
69+
{"categories": [], "template": "## Commits:\n\n${{UNCATEGORIZED}}", "pr_template": "- ${{MERGE_SHA}} ${{TITLE}}"}
70+
EOF
71+
echo "last_tag=$(git describe --tags --match \"genesys-cloud-chatbot-tester-v*\" --abbrev=0 || echo)" >> $GITHUB_ENV
6372
64-
- name: Generate changelog
65-
if: steps.publish.outputs.type != 'none'
66-
id: github_release
73+
- name: Generate changelog for genesys-cloud-chatbot-tester
74+
if: steps.publish_sdk.outputs.type != 'none'
75+
id: changelog_tester
6776
uses: mikepenz/[email protected]
6877
env:
6978
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -73,30 +82,48 @@ jobs:
7382
commitMode: true
7483
configuration: changelog_config.json
7584

76-
- name: Create release
77-
if: steps.publish.outputs.type != 'none'
78-
id: create_release
85+
- name: Create release for genesys-cloud-chatbot-tester
86+
if: steps.publish_sdk.outputs.type != 'none'
7987
uses: actions/create-release@v1
8088
env:
8189
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8290
with:
83-
tag_name: v${{ steps.publish.outputs.version }}
84-
release_name: v${{ steps.publish.outputs.version }}
91+
tag_name: genesys-cloud-chatbot-tester-v${{ steps.publish_sdk.outputs.version }}
92+
release_name: genesys-cloud-chatbot-tester-v${{ steps.publish_sdk.outputs.version }}
8593
commitish: ${{ github.ref }}
86-
body: ${{ steps.github_release.outputs.changelog }}
94+
body: ${{ steps.changelog_tester.outputs.changelog }}
8795
draft: false
8896
prerelease: false
8997

90-
- name: Build .dxt file
91-
if: steps.publish.outputs.type != 'none'
92-
run: npm run package:dxt
98+
- name: Configure changelog for genesys-cloud-chatbot-tester-cli
99+
if: steps.publish_cli.outputs.type != 'none'
100+
run: |
101+
cat <<'EOF' > changelog_config.json
102+
{"categories": [], "template": "## Commits:\n\n${{UNCATEGORIZED}}", "pr_template": "- ${{MERGE_SHA}} ${{TITLE}}"}
103+
EOF
104+
echo "last_tag=$(git describe --tags --match \"genesys-cloud-chatbot-tester-cli-v*\" --abbrev=0 || echo)" >> $GITHUB_ENV
93105
94-
- name: Upload .dxt to GitHub release
95-
if: steps.publish.outputs.type != 'none'
96-
uses: softprops/action-gh-release@v1
106+
- name: Generate changelog for genesys-cloud-chatbot-tester-cli
107+
if: steps.publish_cli.outputs.type != 'none'
108+
id: changelog_cli
109+
uses: mikepenz/[email protected]
110+
env:
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97112
with:
98-
tag_name: v${{ steps.publish.outputs.version }}
99-
files: |
100-
genesys-cloud-mcp-server.dxt
113+
fromTag: "${{ env.last_tag }}"
114+
toTag: ${{ github.ref }}
115+
commitMode: true
116+
configuration: changelog_config.json
117+
118+
- name: Create release for genesys-cloud-chatbot-tester-cli
119+
if: steps.publish_cli.outputs.type != 'none'
120+
uses: actions/create-release@v1
101121
env:
102122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
with:
124+
tag_name: genesys-cloud-chatbot-tester-cli-v${{ steps.publish_cli.outputs.version }}
125+
release_name: genesys-cloud-chatbot-tester-cli-v${{ steps.publish_cli.outputs.version }}
126+
commitish: ${{ github.ref }}
127+
body: ${{ steps.changelog_cli.outputs.changelog }}
128+
draft: false
129+
prerelease: false

0 commit comments

Comments
 (0)