@gesslar/lpc-mcp 1.4.11 → 1.4.13
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.
|
@@ -1,348 +1,14 @@
|
|
|
1
1
|
name: Release
|
|
2
2
|
|
|
3
|
-
permissions:
|
|
4
|
-
contents: read
|
|
5
|
-
|
|
6
3
|
on:
|
|
7
4
|
pull_request:
|
|
8
|
-
types:
|
|
9
|
-
|
|
10
|
-
branches:
|
|
11
|
-
- main
|
|
5
|
+
types: [closed]
|
|
6
|
+
branches: [main]
|
|
12
7
|
|
|
13
8
|
jobs:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
#
|
|
21
|
-
# Example: QUALITY_CHECK="Quality"
|
|
22
|
-
# QUALITY_CHECK=""
|
|
23
|
-
#
|
|
24
|
-
### PACKAGE MANAGER
|
|
25
|
-
#
|
|
26
|
-
# Set the package manager to use: "auto", "npm" or "pnpm
|
|
27
|
-
# This will configure the appropriate setup and commands throughout
|
|
28
|
-
# the workflow.
|
|
29
|
-
#
|
|
30
|
-
# If set to "auto", this workflow will attempt to read the "packageManager"
|
|
31
|
-
# value of the package.json. So, make sure you have one and that you have
|
|
32
|
-
# also set this value. If it discovers pnpm, it will use that and falls
|
|
33
|
-
# back to npm if missing.
|
|
34
|
-
#
|
|
35
|
-
# Example:
|
|
36
|
-
# PACKAGE_MANAGER="auto"
|
|
37
|
-
# PACKAGE_MANAGER="pnpm"
|
|
38
|
-
# PACKAGE_MANAGER="npm"
|
|
39
|
-
#
|
|
40
|
-
### GIT CONFIGURATION
|
|
41
|
-
#
|
|
42
|
-
# Configure the Git user for tagging operations.
|
|
43
|
-
#
|
|
44
|
-
# Example: GIT_USER_NAME="github-actions"
|
|
45
|
-
# GIT_USER_EMAIL="github-actions@github.com"
|
|
46
|
-
#
|
|
47
|
-
#####################################################################
|
|
48
|
-
|
|
49
|
-
ConfigureWorkflow:
|
|
50
|
-
runs-on: ubuntu-latest
|
|
51
|
-
|
|
52
|
-
outputs:
|
|
53
|
-
quality_check: ${{ steps.cfg_main.outputs.quality_check }}
|
|
54
|
-
git_user_name: ${{ steps.cfg_main.outputs.git_user_name }}
|
|
55
|
-
git_user_email: ${{ steps.cfg_main.outputs.git_user_email }}
|
|
56
|
-
package_manager: ${{ steps.cfg_pm.outputs.package_manager }}
|
|
57
|
-
pm_install_cmd: ${{ steps.cfg_pm.outputs.pm_install_cmd }}
|
|
58
|
-
pm_default: ${{ steps.cfg_main.outputs.pm_default }}
|
|
59
|
-
pm_version: ${{ steps.cfg_pm.outputs.pm_version }}
|
|
60
|
-
node_version: ${{ steps.cfg_node.outputs.node_version }}
|
|
61
|
-
|
|
62
|
-
steps:
|
|
63
|
-
- name: Configure workflow
|
|
64
|
-
id: cfg_main
|
|
65
|
-
run: |+
|
|
66
|
-
#############################################################
|
|
67
|
-
QUALITY_CHECK="Quality"
|
|
68
|
-
PACKAGE_MANAGER="auto"
|
|
69
|
-
GIT_USER_NAME="github-actions"
|
|
70
|
-
GIT_USER_EMAIL="github-actions@github.com"
|
|
71
|
-
#############################################################
|
|
72
|
-
|
|
73
|
-
# Apply configuration
|
|
74
|
-
echo "quality_check=${QUALITY_CHECK}" >> "$GITHUB_OUTPUT"
|
|
75
|
-
echo "git_user_name=${GIT_USER_NAME}" >> "$GITHUB_OUTPUT"
|
|
76
|
-
echo "git_user_email=${GIT_USER_EMAIL}" >> "$GITHUB_OUTPUT"
|
|
77
|
-
echo "package_manager=${PACKAGE_MANAGER}" >> "$GITHUB_OUTPUT"
|
|
78
|
-
echo "pm_default=npm" >> "$GITHUB_OUTPUT"
|
|
79
|
-
|
|
80
|
-
- name: Check out repository
|
|
81
|
-
uses: actions/checkout@v6
|
|
82
|
-
|
|
83
|
-
- name: Configure Package Manager
|
|
84
|
-
id: cfg_pm
|
|
85
|
-
run: |+
|
|
86
|
-
set -euo pipefail
|
|
87
|
-
|
|
88
|
-
PM_DEFAULT="${{ steps.cfg_main.outputs.pm_default }}"
|
|
89
|
-
PACKAGE_MANAGER="${{ steps.cfg_main.outputs.package_manager }}"
|
|
90
|
-
PM_VERSION=""
|
|
91
|
-
|
|
92
|
-
if [[ "$PACKAGE_MANAGER" = "auto" ]]; then
|
|
93
|
-
printf "Package manager set to 'auto'.\n"
|
|
94
|
-
printf "Detecting: "
|
|
95
|
-
|
|
96
|
-
PM=$(jq -r .packageManager package.json)
|
|
97
|
-
printf "PM=%s\n" "$PM"
|
|
98
|
-
|
|
99
|
-
if [[ ! "$PM" ]]; then
|
|
100
|
-
PACKAGE_MANAGER="$PM_DEFAULT"
|
|
101
|
-
elif [[ "$PM" =~ ^(pnpm)@([[:digit:]]+.[[:digit:]]+.[[:digit:]]+)$ ]]; then
|
|
102
|
-
PACKAGE_MANAGER="${BASH_REMATCH[1]}"
|
|
103
|
-
PM_VERSION="${BASH_REMATCH[2]}"
|
|
104
|
-
else
|
|
105
|
-
PACKAGE_MANAGER="$PM_DEFAULT"
|
|
106
|
-
PM_VERSION=""
|
|
107
|
-
fi
|
|
108
|
-
fi
|
|
109
|
-
|
|
110
|
-
echo "package_manager=${PACKAGE_MANAGER}" >> "$GITHUB_OUTPUT"
|
|
111
|
-
echo "pm_version=${PM_VERSION}" >> "$GITHUB_OUTPUT"
|
|
112
|
-
|
|
113
|
-
if [[ "$PACKAGE_MANAGER" = "pnpm" ]]; then
|
|
114
|
-
echo "pm_install_cmd=pnpm install --frozen-lockfile" >> "$GITHUB_OUTPUT"
|
|
115
|
-
else
|
|
116
|
-
echo "pm_install_cmd=npm ci" >> "$GITHUB_OUTPUT"
|
|
117
|
-
fi
|
|
118
|
-
|
|
119
|
-
- name: Configure Node Version
|
|
120
|
-
id: cfg_node
|
|
121
|
-
run: |+
|
|
122
|
-
set -euo pipefail
|
|
123
|
-
|
|
124
|
-
NODE_VERSION=""
|
|
125
|
-
|
|
126
|
-
if ! NODE_RAW=$(jq -er '.engines.node' package.json); then
|
|
127
|
-
echo "::error::engines.node is required in package.json."
|
|
128
|
-
exit 1
|
|
129
|
-
fi
|
|
130
|
-
|
|
131
|
-
if [[ "$NODE_RAW" =~ [^0-9]*([0-9]+) ]]; then
|
|
132
|
-
NODE_VERSION="${BASH_REMATCH[1]}"
|
|
133
|
-
else
|
|
134
|
-
echo "::error::Unable to parse engines.node ('${NODE_RAW}') for a Node.js version."
|
|
135
|
-
exit 1
|
|
136
|
-
fi
|
|
137
|
-
|
|
138
|
-
echo "node_version=${NODE_VERSION}" >> "$GITHUB_OUTPUT"
|
|
139
|
-
|
|
140
|
-
- name: Display Configuration
|
|
141
|
-
run: |+
|
|
142
|
-
printf "Package Manager: %s" "${{ steps.cfg_pm.outputs.package_manager }}"
|
|
143
|
-
|
|
144
|
-
if [[ "${{ steps.cfg_pm.outputs.package_manager }}" = "pnpm" ]]; then
|
|
145
|
-
printf " (%s)\n" "${{ steps.cfg_pm.outputs.pm_version }}"
|
|
146
|
-
else
|
|
147
|
-
printf "\n"
|
|
148
|
-
fi
|
|
149
|
-
|
|
150
|
-
printf "Package Manager Install: %s\n" "${{ steps.cfg_pm.outputs.pm_install_cmd }}"
|
|
151
|
-
printf "Node: %s\n" "${{ steps.cfg_node.outputs.node_version }}"
|
|
152
|
-
|
|
153
|
-
WaitForQuality:
|
|
154
|
-
needs: ConfigureWorkflow
|
|
155
|
-
runs-on: ubuntu-latest
|
|
156
|
-
if: ${{ github.event.pull_request.merged == true }}
|
|
157
|
-
|
|
158
|
-
steps:
|
|
159
|
-
- name: Wait for Quality workflow to complete
|
|
160
|
-
if: ${{ needs.ConfigureWorkflow.outputs.quality_check != '' }}
|
|
161
|
-
uses: lewagon/wait-on-check-action@v1.3.4
|
|
162
|
-
with:
|
|
163
|
-
ref: ${{ github.ref }}
|
|
164
|
-
running-workflow-name: ${{ needs.ConfigureWorkflow.outputs.quality_check }}
|
|
165
|
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
166
|
-
wait-interval: 10
|
|
167
|
-
|
|
168
|
-
- name: Skipping wait (no quality_check configured)
|
|
169
|
-
if: ${{ needs.ConfigureWorkflow.outputs.quality_check == '' }}
|
|
170
|
-
run: echo "No quality check configured; continuing."
|
|
171
|
-
|
|
172
|
-
DetermineVersion:
|
|
173
|
-
needs: WaitForQuality
|
|
174
|
-
runs-on: ubuntu-latest
|
|
175
|
-
if: ${{ github.event.pull_request.merged == true }}
|
|
176
|
-
|
|
177
|
-
outputs:
|
|
178
|
-
version: ${{ steps.version.outputs.VERSION }}
|
|
179
|
-
|
|
180
|
-
steps:
|
|
181
|
-
- uses: actions/checkout@v4
|
|
182
|
-
with:
|
|
183
|
-
fetch-depth: 0
|
|
184
|
-
|
|
185
|
-
- name: Determine version
|
|
186
|
-
id: check_version
|
|
187
|
-
uses: gesslar/new-version-questionmark@v1.5.5
|
|
188
|
-
with:
|
|
189
|
-
source: package.json
|
|
190
|
-
version_pattern: "^v\\d+\\.\\d+\\.\\d+$"
|
|
191
|
-
|
|
192
|
-
- name: Show result
|
|
193
|
-
id: version
|
|
194
|
-
run: |+
|
|
195
|
-
UPDATED_VERSION="${{ steps.check_version.outputs.updated_version }}"
|
|
196
|
-
|
|
197
|
-
if [[ "$UPDATED_VERSION" == "no changes" ]]; then
|
|
198
|
-
echo "VERSION=🙅🏻♂️" >> "$GITHUB_OUTPUT"
|
|
199
|
-
else
|
|
200
|
-
echo "VERSION=${UPDATED_VERSION}" >> "$GITHUB_OUTPUT"
|
|
201
|
-
fi
|
|
202
|
-
|
|
203
|
-
CreateTag:
|
|
204
|
-
needs: [ConfigureWorkflow, DetermineVersion]
|
|
205
|
-
if: ${{ needs.DetermineVersion.outputs.version != '🙅🏻♂️' }}
|
|
206
|
-
runs-on: ubuntu-latest
|
|
207
|
-
|
|
208
|
-
permissions:
|
|
209
|
-
contents: write
|
|
210
|
-
|
|
211
|
-
outputs:
|
|
212
|
-
new_tag: ${{ steps.check_tag.outputs.new_tag }}
|
|
213
|
-
|
|
214
|
-
steps:
|
|
215
|
-
- name: Checkout code
|
|
216
|
-
uses: actions/checkout@v6
|
|
217
|
-
|
|
218
|
-
- name: Install pnpm
|
|
219
|
-
if: ${{ needs.ConfigureWorkflow.outputs.package_manager == 'pnpm' }}
|
|
220
|
-
uses: pnpm/action-setup@v4
|
|
221
|
-
with:
|
|
222
|
-
version: ${{ needs.ConfigureWorkflow.outputs.pm_version }}
|
|
223
|
-
|
|
224
|
-
- name: Setup Git Variables
|
|
225
|
-
run: |+
|
|
226
|
-
git config user.name "${{ needs.ConfigureWorkflow.outputs.git_user_name }}"
|
|
227
|
-
git config user.email "${{ needs.ConfigureWorkflow.outputs.git_user_email }}"
|
|
228
|
-
|
|
229
|
-
- name: Set up Node.js
|
|
230
|
-
uses: actions/setup-node@v6
|
|
231
|
-
with:
|
|
232
|
-
node-version: ${{ needs.ConfigureWorkflow.outputs.node_version }}
|
|
233
|
-
cache: ${{ needs.ConfigureWorkflow.outputs.package_manager }}
|
|
234
|
-
|
|
235
|
-
- name: Install dependencies
|
|
236
|
-
run: ${{ needs.ConfigureWorkflow.outputs.pm_install_cmd }}
|
|
237
|
-
|
|
238
|
-
- name: Read version from package.json
|
|
239
|
-
id: get_version
|
|
240
|
-
run: |
|
|
241
|
-
CURRENT_VERSION=${{ needs.DetermineVersion.outputs.version }}
|
|
242
|
-
|
|
243
|
-
- name: Fetch all tags
|
|
244
|
-
run: git fetch --tags
|
|
245
|
-
|
|
246
|
-
- name: Check for existing tag and create if it does not exist
|
|
247
|
-
id: check_tag
|
|
248
|
-
run: |+
|
|
249
|
-
CURRENT_VERSION="${{ needs.DetermineVersion.outputs.version }}"
|
|
250
|
-
TAG_EXISTS=$(git tag -l "v${CURRENT_VERSION}")
|
|
251
|
-
|
|
252
|
-
echo "Value of TAG_EXISTS: $TAG_EXISTS"
|
|
253
|
-
|
|
254
|
-
if [ -z "$TAG_EXISTS" ]; then
|
|
255
|
-
echo "Tag does not exist for version v${CURRENT_VERSION}. Creating tag."
|
|
256
|
-
git tag "v${CURRENT_VERSION}"
|
|
257
|
-
git push origin "v${CURRENT_VERSION}"
|
|
258
|
-
echo "new_tag=v${CURRENT_VERSION}" >> $GITHUB_OUTPUT
|
|
259
|
-
else
|
|
260
|
-
echo "Tag already exists for version v${CURRENT_VERSION}. Skipping tag creation."
|
|
261
|
-
echo "new_tag=🙅🏻♂️" >> $GITHUB_OUTPUT
|
|
262
|
-
exit 0
|
|
263
|
-
fi
|
|
264
|
-
|
|
265
|
-
PrepareGitHubRelease:
|
|
266
|
-
needs: [ConfigureWorkflow, CreateTag]
|
|
267
|
-
runs-on: ubuntu-latest
|
|
268
|
-
if: ${{ needs.CreateTag.outputs.new_tag != '🙅🏻♂️' }}
|
|
269
|
-
|
|
270
|
-
permissions:
|
|
271
|
-
contents: write
|
|
272
|
-
|
|
273
|
-
env:
|
|
274
|
-
NEW_TAG: ${{ needs.CreateTag.outputs.new_tag }}
|
|
275
|
-
|
|
276
|
-
steps:
|
|
277
|
-
- name: Setup New Tag
|
|
278
|
-
run: |
|
|
279
|
-
echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
|
|
280
|
-
|
|
281
|
-
- name: Checkout code
|
|
282
|
-
uses: actions/checkout@v6
|
|
283
|
-
|
|
284
|
-
- name: Install pnpm
|
|
285
|
-
if: ${{ needs.ConfigureWorkflow.outputs.package_manager == 'pnpm' }}
|
|
286
|
-
uses: pnpm/action-setup@v4
|
|
287
|
-
with:
|
|
288
|
-
version: ${{ needs.ConfigureWorkflow.outputs.pm_version }}
|
|
289
|
-
|
|
290
|
-
- name: Setup Git Variables
|
|
291
|
-
run: |
|
|
292
|
-
git config user.name "${{ needs.ConfigureWorkflow.outputs.git_user_name }}"
|
|
293
|
-
git config user.email "${{ needs.ConfigureWorkflow.outputs.git_user_email }}"
|
|
294
|
-
|
|
295
|
-
- name: Set up Node.js
|
|
296
|
-
uses: actions/setup-node@v6
|
|
297
|
-
with:
|
|
298
|
-
node-version: ${{ needs.ConfigureWorkflow.outputs.node_version }}
|
|
299
|
-
cache: ${{ needs.ConfigureWorkflow.outputs.package_manager }}
|
|
300
|
-
|
|
301
|
-
- name: Install dependencies
|
|
302
|
-
run: ${{ needs.ConfigureWorkflow.outputs.pm_install_cmd }}
|
|
303
|
-
|
|
304
|
-
- name: Build artefact
|
|
305
|
-
run: |
|
|
306
|
-
ARTEFACT=$(${{ needs.ConfigureWorkflow.outputs.package_manager }} pack | tail -1)
|
|
307
|
-
echo "ARTEFACT=${ARTEFACT}" >> $GITHUB_ENV
|
|
308
|
-
|
|
309
|
-
- name: Create Release
|
|
310
|
-
env:
|
|
311
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
312
|
-
run: >
|
|
313
|
-
set -x;
|
|
314
|
-
gh release create "${{ env.NEW_TAG }}"
|
|
315
|
-
--title "Release ${{ env.NEW_TAG }}"
|
|
316
|
-
--generate-notes
|
|
317
|
-
"${{ env.ARTEFACT }}"
|
|
318
|
-
|
|
319
|
-
PublishToNPM:
|
|
320
|
-
needs: [ConfigureWorkflow, DetermineVersion]
|
|
321
|
-
if: ${{ github.event.pull_request.merged == true && needs.DetermineVersion.outputs.version != '🙅🏻♂️' }}
|
|
322
|
-
runs-on: ubuntu-latest
|
|
323
|
-
|
|
324
|
-
permissions:
|
|
325
|
-
contents: write
|
|
326
|
-
|
|
327
|
-
env:
|
|
328
|
-
TOKEN: ${{ secrets.NPM_GITHUB_CD_ACCESS_TOKEN }}
|
|
329
|
-
|
|
330
|
-
steps:
|
|
331
|
-
- name: Checkout code
|
|
332
|
-
uses: actions/checkout@v6
|
|
333
|
-
|
|
334
|
-
- name: Install pnpm
|
|
335
|
-
if: ${{ needs.ConfigureWorkflow.outputs.package_manager == 'pnpm' }}
|
|
336
|
-
uses: pnpm/action-setup@v4
|
|
337
|
-
with:
|
|
338
|
-
version: ${{ needs.ConfigureWorkflow.outputs.pm_version }}
|
|
339
|
-
|
|
340
|
-
- name: Set up Node.js
|
|
341
|
-
uses: actions/setup-node@v6
|
|
342
|
-
with:
|
|
343
|
-
node-version: ${{ needs.ConfigureWorkflow.outputs.node_version }}
|
|
344
|
-
cache: ${{ needs.ConfigureWorkflow.outputs.package_manager }}
|
|
345
|
-
|
|
346
|
-
- name: Ship it
|
|
347
|
-
run: |
|
|
348
|
-
${{ needs.ConfigureWorkflow.outputs.package_manager }} publish --access public --//registry.npmjs.org/:_authToken=${TOKEN}
|
|
9
|
+
Release:
|
|
10
|
+
uses: gesslar/Maint/.github/workflows/Release.yaml@main
|
|
11
|
+
secrets: inherit
|
|
12
|
+
with:
|
|
13
|
+
package_manager: "auto"
|
|
14
|
+
quality_check: "Quality"
|