Skip to content

Commit 60d98eb

Browse files
authored
Simplify release note creation (#12)
1 parent 8e8f141 commit 60d98eb

File tree

2 files changed

+23
-48
lines changed

2 files changed

+23
-48
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ jobs:
1717
name: Detect changed packages
1818
runs-on: ubuntu-latest
1919
outputs:
20-
sdk: ${{ steps.filter.outputs.sdk }}
20+
lib: ${{ steps.filter.outputs.lib }}
2121
cli: ${{ steps.filter.outputs.cli }}
2222
steps:
2323
- uses: actions/checkout@v4
2424
- id: filter
2525
uses: dorny/paths-filter@v3
2626
with:
2727
filters: |
28-
sdk:
28+
lib:
2929
- 'packages/genesys-cloud-chatbot-tester/package.json'
3030
cli:
3131
- 'packages/genesys-cloud-chatbot-tester-cli/package.json'
3232
33-
publish_sdk:
33+
publish_lib:
3434
name: Publish genesys-cloud-chatbot-tester
3535
needs: changes
36-
if: needs.changes.outputs.sdk == 'true'
36+
if: needs.changes.outputs.lib == 'true'
3737
runs-on: ubuntu-latest
3838

3939
steps:
@@ -72,31 +72,18 @@ jobs:
7272
if: steps.publish.outputs.type != 'none'
7373
run: echo "Published genesys-cloud-chatbot-tester ${{ steps.publish.outputs.version }}"
7474

75-
- name: Configure changelog
76-
if: steps.publish.outputs.type != 'none'
77-
run: |
78-
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
79-
echo "last_tag=$(git describe --tags --match 'genesys-cloud-chatbot-tester-v*' --abbrev=0)" >> $GITHUB_ENV
80-
81-
- name: Generate changelog
82-
if: steps.publish.outputs.type != 'none'
83-
id: changelog
84-
uses: mikepenz/[email protected]
85-
env:
86-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
with:
88-
fromTag: "${{ env.last_tag }}"
89-
toTag: ${{ github.sha }}
90-
commitMode: true
91-
configuration: changelog_config.json
92-
9375
- name: Create GitHub release
9476
if: steps.publish.outputs.type != 'none'
9577
run: |
96-
gh release create "genesys-cloud-chatbot-tester-v${{ steps.publish.outputs.version }}" \
97-
--title "genesys-cloud-chatbot-tester-v${{ steps.publish.outputs.version }}" \
98-
--target "${{ github.sha }}" \
99-
--notes "${{ steps.changelog.outputs.changelog }}"
78+
TAG="genesys-cloud-chatbot-tester-v${{ steps.publish.outputs.version }}"
79+
if gh release view "$TAG" >/dev/null 2>&1; then
80+
echo "Release $TAG already exists; skipping."
81+
else
82+
gh release create "$TAG" \
83+
--title "$TAG" \
84+
--target "${{ github.sha }}" \
85+
--generate-notes
86+
fi
10087
env:
10188
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10289

@@ -142,30 +129,17 @@ jobs:
142129
if: steps.publish.outputs.type != 'none'
143130
run: echo "Published genesys-cloud-chatbot-tester-cli ${{ steps.publish.outputs.version }}"
144131

145-
- name: Configure changelog
146-
if: steps.publish.outputs.type != 'none'
147-
run: |
148-
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
149-
echo "last_tag=$(git describe --tags --match 'genesys-cloud-chatbot-tester-cli-v*' --abbrev=0)" >> $GITHUB_ENV
150-
151-
- name: Generate changelog
152-
if: steps.publish.outputs.type != 'none'
153-
id: changelog
154-
uses: mikepenz/[email protected]
155-
env:
156-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157-
with:
158-
fromTag: "${{ env.last_tag }}"
159-
toTag: ${{ github.sha }}
160-
commitMode: true
161-
configuration: changelog_config.json
162-
163132
- name: Create GitHub release
164133
if: steps.publish.outputs.type != 'none'
165134
run: |
166-
gh release create "genesys-cloud-chatbot-tester-cli-v${{ steps.publish.outputs.version }}" \
167-
--title "genesys-cloud-chatbot-tester-cli-v${{ steps.publish.outputs.version }}" \
168-
--target "${{ github.sha }}" \
169-
--notes "${{ steps.changelog.outputs.changelog }}"
135+
TAG="genesys-cloud-chatbot-tester-cli-v${{ steps.publish.outputs.version }}"
136+
if gh release view "$TAG" >/dev/null 2>&1; then
137+
echo "Release $TAG already exists; skipping."
138+
else
139+
gh release create "$TAG" \
140+
--title "$TAG" \
141+
--target "${{ github.sha }}" \
142+
--generate-notes
143+
fi
170144
env:
171145
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@makingchatbots/genesys-cloud-chatbot-tester",
33
"version": "2.0.10",
4+
"description": "A testing library for Genesys Cloud Web Messenger chatbots.",
45
"main": "lib/index.js",
56
"types": "lib/index.d.ts",
67
"license": "Apache-2.0",

0 commit comments

Comments
 (0)