freemium-ui 2.0.129 → 2.0.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/automated-version-bump.yml +51 -10
- package/lib/index.cjs.js +3816 -3791
- package/lib/index.d.ts +6 -0
- package/lib/index.js +4103 -4077
- package/lib/package.json +1 -1
- package/package.json +1 -1
|
@@ -21,13 +21,24 @@ permissions:
|
|
|
21
21
|
pull-requests: write
|
|
22
22
|
packages: write
|
|
23
23
|
|
|
24
|
+
# Bump this when you change the workflow file
|
|
25
|
+
env:
|
|
26
|
+
WORKFLOW_VERSION: '1.0.0'
|
|
27
|
+
|
|
24
28
|
jobs:
|
|
25
29
|
create-version-pr:
|
|
26
30
|
name: Create Version Bump PR
|
|
27
31
|
runs-on: fw-shared
|
|
28
32
|
if: github.event_name == 'workflow_dispatch'
|
|
33
|
+
permissions:
|
|
34
|
+
contents: write
|
|
35
|
+
pull-requests: write
|
|
29
36
|
|
|
30
37
|
steps:
|
|
38
|
+
- name: Log workflow version
|
|
39
|
+
run: |
|
|
40
|
+
echo "Workflow file version: ${{ env.WORKFLOW_VERSION }}"
|
|
41
|
+
|
|
31
42
|
- name: Checkout code
|
|
32
43
|
uses: actions/checkout@v4
|
|
33
44
|
with:
|
|
@@ -101,8 +112,11 @@ jobs:
|
|
|
101
112
|
run: git push origin ${{ steps.branch.outputs.branch_name }}
|
|
102
113
|
|
|
103
114
|
- name: Create Pull Request
|
|
115
|
+
id: create_pr
|
|
104
116
|
run: |
|
|
105
|
-
|
|
117
|
+
BRANCH="${{ steps.branch.outputs.branch_name }}"
|
|
118
|
+
PR_URL=""
|
|
119
|
+
if PR_URL=$(gh pr create \
|
|
106
120
|
--title "chore(release): bump version to ${{ steps.version_bump.outputs.new_version }}" \
|
|
107
121
|
--body "## Automated Version Bump: ${{ steps.version_bump.outputs.new_version }}
|
|
108
122
|
|
|
@@ -123,11 +137,24 @@ jobs:
|
|
|
123
137
|
- GitHub release created
|
|
124
138
|
|
|
125
139
|
**Merge this PR to trigger automated publishing!**" \
|
|
126
|
-
--head $
|
|
127
|
-
--base main)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
140
|
+
--head "$BRANCH" \
|
|
141
|
+
--base main 2>/dev/null); then
|
|
142
|
+
echo "PR created via gh pr create"
|
|
143
|
+
fi
|
|
144
|
+
if [ -z "$PR_URL" ]; then
|
|
145
|
+
PR_URL=$(gh pr list --head "$BRANCH" --json url --limit 1 -q '.[0].url' 2>/dev/null || true)
|
|
146
|
+
if [ -n "$PR_URL" ]; then
|
|
147
|
+
echo "PR already exists for branch; retrieved URL"
|
|
148
|
+
fi
|
|
149
|
+
fi
|
|
150
|
+
if [ -n "$PR_URL" ]; then
|
|
151
|
+
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
|
|
152
|
+
echo "Pull request created: $PR_URL"
|
|
153
|
+
echo "Review and merge to complete: $PR_URL"
|
|
154
|
+
else
|
|
155
|
+
echo "::error::gh pr create failed and no PR found for branch $BRANCH. Enable GITHUB_TOKEN write access: Settings → Actions → General → Workflow permissions → Read and write permissions"
|
|
156
|
+
exit 1
|
|
157
|
+
fi
|
|
131
158
|
env:
|
|
132
159
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
160
|
|
|
@@ -137,6 +164,10 @@ jobs:
|
|
|
137
164
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
138
165
|
|
|
139
166
|
steps:
|
|
167
|
+
- name: Log workflow version
|
|
168
|
+
run: |
|
|
169
|
+
echo "Workflow file version: ${{ env.WORKFLOW_VERSION }}"
|
|
170
|
+
|
|
140
171
|
- name: Checkout code
|
|
141
172
|
uses: actions/checkout@v4
|
|
142
173
|
with:
|
|
@@ -184,12 +215,17 @@ jobs:
|
|
|
184
215
|
echo "No version bump indicators found"
|
|
185
216
|
fi
|
|
186
217
|
|
|
218
|
+
- name: Configure npm for GitHub Packages
|
|
219
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
220
|
+
run: |
|
|
221
|
+
echo "@freshdesk:registry=https://npm.pkg.github.com/" >> .npmrc
|
|
222
|
+
echo "@freshworks:registry=https://npm.pkg.github.com/" >> .npmrc
|
|
223
|
+
echo "@freshworksinc:registry=https://npm.pkg.github.com/" >> .npmrc
|
|
224
|
+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_AUTH_TOKEN }}" >> .npmrc
|
|
225
|
+
|
|
187
226
|
- name: Install dependencies and build
|
|
188
227
|
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
189
228
|
run: |
|
|
190
|
-
# Authenticate for GitHub Packages
|
|
191
|
-
echo "@freshworks:registry=https://npm.pkg.github.com" >> ~/.npmrc
|
|
192
|
-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_PACKAGES_TOKEN }}" >> ~/.npmrc
|
|
193
229
|
npm ci
|
|
194
230
|
npm run build
|
|
195
231
|
|
|
@@ -284,11 +320,16 @@ jobs:
|
|
|
284
320
|
|
|
285
321
|
- name: Notify Slack channel
|
|
286
322
|
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
323
|
+
continue-on-error: true
|
|
287
324
|
run: |
|
|
325
|
+
if [ -z "$SLACK_WEBHOOK_URL" ]; then
|
|
326
|
+
echo "SLACK_WEBHOOK_URL secret not set; skipping Slack notification."
|
|
327
|
+
exit 0
|
|
328
|
+
fi
|
|
288
329
|
RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ steps.check_version.outputs.version }}"
|
|
289
330
|
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
290
331
|
MESSAGE=":tada: *New Release Published!* \nPackage: *${PACKAGE_NAME}* \nVersion: *${{ steps.check_version.outputs.version }}* \nReleased by: @${{ github.actor }} \n<${RELEASE_URL}|View Release Notes>"
|
|
291
|
-
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MESSAGE\"}" "$
|
|
332
|
+
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MESSAGE\"}" "$SLACK_WEBHOOK_URL"
|
|
292
333
|
echo "Slack notification sent!"
|
|
293
334
|
env:
|
|
294
335
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|