forked from ovotech/genesys-web-messaging-tester
-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (150 loc) · 5.41 KB
/
release.yml
File metadata and controls
173 lines (150 loc) · 5.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Release on npm
on:
push:
branches:
- "main"
paths:
- packages/**/package.json
permissions:
contents: write
pull-requests: read
id-token: write
jobs:
changes:
name: Detect changed packages
runs-on: ubuntu-latest
outputs:
sdk: ${{ steps.filter.outputs.sdk }}
cli: ${{ steps.filter.outputs.cli }}
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@v3
with:
filters: |
sdk:
- 'packages/genesys-cloud-chatbot-tester/package.json'
cli:
- 'packages/genesys-cloud-chatbot-tester-cli/package.json'
publish_sdk:
name: Publish genesys-cloud-chatbot-tester
needs: changes
if: needs.changes.outputs.sdk == 'true'
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'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: |
npm run clean
npm run build
- id: publish
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
- name: Post-publish
if: steps.publish.outputs.type != 'none'
run: echo "Published genesys-cloud-chatbot-tester ${{ steps.publish.outputs.version }}"
- name: Configure changelog
if: steps.publish.outputs.type != 'none'
run: |
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
echo "last_tag=$(git describe --tags --match 'genesys-cloud-chatbot-tester-v*' --abbrev=0)" >> $GITHUB_ENV
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Generate changelog
if: steps.publish.outputs.type != 'none'
id: changelog
uses: mikepenz/release-changelog-builder-action@v2.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.sha }}
commitMode: true
configuration: changelog_config.json
- name: Create GitHub release
if: steps.publish.outputs.type != 'none'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: genesys-cloud-chatbot-tester-v${{ steps.publish.outputs.version }}
release_name: genesys-cloud-chatbot-tester-v${{ steps.publish.outputs.version }}
commitish: ${{ github.sha }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
publish_cli:
name: Publish genesys-cloud-chatbot-tester-cli
needs: changes
if: needs.changes.outputs.cli == 'true'
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'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: |
npm run clean
npm run build
- id: publish
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
if: steps.publish.outputs.type != 'none'
run: echo "Published genesys-cloud-chatbot-tester-cli ${{ steps.publish.outputs.version }}"
- name: Configure changelog
if: steps.publish.outputs.type != 'none'
run: |
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json
echo "last_tag=$(git describe --tags --match 'genesys-cloud-chatbot-tester-cli-v*' --abbrev=0)" >> $GITHUB_ENV
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Generate changelog
if: steps.publish.outputs.type != 'none'
id: changelog
uses: mikepenz/release-changelog-builder-action@v2.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.last_tag }}"
toTag: ${{ github.sha }}
commitMode: true
configuration: changelog_config.json
- name: Create GitHub release
if: steps.publish.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.outputs.version }}
release_name: genesys-cloud-chatbot-tester-cli-v${{ steps.publish.outputs.version }}
commitish: ${{ github.sha }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false