Skip to content

Commit ccb66f8

Browse files
committed
Merge remote-tracking branch 'upstream/alpha' into alpha
2 parents 85a52d8 + 68922c8 commit ccb66f8

File tree

6 files changed

+7160
-5014
lines changed

6 files changed

+7160
-5014
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,10 @@ jobs:
4242
uses: actions/setup-node@v4
4343
with:
4444
node-version: ${{ matrix.node-version }}
45-
- name: Cache Node.js modules
46-
uses: actions/cache@v4
47-
with:
48-
path: ~/.npm
49-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
50-
restore-keys: |
51-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
52-
- name: Install dependencies
45+
- name: Install prod dependencies
5346
run: npm ci
47+
- name: Remove dev dependencies
48+
run: ./ci/uninstallDevDeps.sh @actions/core
5449
- name: CI Node Engine Check
5550
run: npm run ci:checkNodeEngine
5651
check-lint:

.github/workflows/release-automated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
persist-credentials: false
1818
- uses: actions/setup-node@v4
1919
with:
20-
node-version: 18.20.0
20+
node-version: 20
2121
registry-url: https://registry.npmjs.org/
2222
- name: Cache Node.js modules
2323
uses: actions/cache@v4

release.config.js renamed to .releaserc.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
* Semantic Release Config
33
*/
44

5-
const fs = require('fs').promises;
6-
const path = require('path');
5+
const { readFile } = require('fs').promises;
6+
const { resolve } = require('path');
7+
8+
// For ES6 modules use:
9+
// import { readFile } from 'fs/promises';
10+
// import { resolve, dirname } from 'path';
11+
// import { fileURLToPath } from 'url';
712

813
// Get env vars
914
const ref = process.env.GITHUB_REF;
@@ -24,7 +29,7 @@ const templates = {
2429
async function config() {
2530

2631
// Get branch
27-
const branch = ref.split('/').pop().split('-')[0];
32+
const branch = ref?.split('/')?.pop()?.split('-')[0] || '(current branch could not be determined)';
2833
console.log(`Running on branch: ${branch}`);
2934

3035
// Set changelog file
@@ -89,7 +94,7 @@ async function config() {
8994
[
9095
"@saithodev/semantic-release-backmerge",
9196
{
92-
"branches": [
97+
"backmergeBranches": [
9398
{ from: "beta", to: "alpha" },
9499
{ from: "release", to: "beta" },
95100
]
@@ -103,15 +108,17 @@ async function config() {
103108

104109
async function loadTemplates() {
105110
for (const template of Object.keys(templates)) {
106-
const text = await readFile(path.resolve(__dirname, resourcePath, templates[template].file));
111+
112+
// For ES6 modules use:
113+
// const fileUrl = import.meta.url;
114+
// const __dirname = dirname(fileURLToPath(fileUrl));
115+
116+
const filePath = resolve(__dirname, resourcePath, templates[template].file);
117+
const text = await readFile(filePath, 'utf-8');
107118
templates[template].text = text;
108119
}
109120
}
110121

111-
async function readFile(filePath) {
112-
return await fs.readFile(filePath, 'utf-8');
113-
}
114-
115122
function getReleaseComment() {
116123
const url = repositoryUrl + '/releases/tag/${nextRelease.gitTag}';
117124
const comment = '🎉 This change has been released in version [${nextRelease.version}](' + url + ')';

ci/uninstallDevDeps.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Read package exclusion list from arguments
4+
exclusionList=("$@")
5+
6+
# Convert exclusion list to grep pattern
7+
exclusionPattern=$(printf "|%s" "${exclusionList[@]}")
8+
exclusionPattern=${exclusionPattern:1}
9+
10+
# Get list of all dev dependencies
11+
devDeps=$(jq -r '.devDependencies | keys | .[]' package.json)
12+
13+
# Filter out exclusion list
14+
depsToUninstall=$(echo "$devDeps" | grep -Ev "$exclusionPattern")
15+
16+
# If there are dependencies to uninstall then uninstall them
17+
if [ -n "$depsToUninstall" ]; then
18+
echo "Uninstalling dev dependencies: $depsToUninstall"
19+
npm uninstall $depsToUninstall
20+
else
21+
echo "No dev dependencies to uninstall"
22+
fi

0 commit comments

Comments
 (0)