Skip to content

Commit cc39d1e

Browse files
committed
PCI test
1 parent 3c13034 commit cc39d1e

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: "Publish to GitHub Packages"
2+
3+
on:
4+
push:
5+
branches:
6+
- 1.57.0-exaforce-pci
7+
workflow_dispatch:
8+
9+
env:
10+
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
11+
12+
jobs:
13+
publish-to-github-packages:
14+
name: "Build and Publish to GitHub Packages"
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
contents: read
18+
packages: write
19+
steps:
20+
- uses: actions/checkout@v5
21+
22+
- uses: actions/setup-node@v6
23+
with:
24+
node-version: 20
25+
registry-url: 'https://npm.pkg.github.com'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Scope packages for GitHub Packages
34+
run: |
35+
# Get the repository owner (lowercase required for GitHub Packages)
36+
OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
37+
38+
# Update each public package to use the scoped name
39+
node ./utils/workspace.js --list-public-package-paths | while read package_path
40+
do
41+
if [ -f "${package_path}/package.json" ]; then
42+
# Get the current package name
43+
PKG_NAME=$(node -e "console.log(require('${package_path}/package.json').name)")
44+
45+
# Create scoped name (remove any existing scope first)
46+
BASE_NAME=$(echo "$PKG_NAME" | sed 's/@[^/]*\///')
47+
SCOPED_NAME="@${OWNER}/${BASE_NAME}"
48+
49+
# Update package.json with scoped name and registry
50+
node -e "
51+
const fs = require('fs');
52+
const pkg = require('${package_path}/package.json');
53+
pkg.name = '${SCOPED_NAME}';
54+
pkg.publishConfig = { registry: 'https://npm.pkg.github.com' };
55+
pkg.repository = { type: 'git', url: 'https://github.com/${{ github.repository }}.git' };
56+
fs.writeFileSync('${package_path}/package.json', JSON.stringify(pkg, null, 2) + '\n');
57+
"
58+
echo "Scoped ${PKG_NAME} -> ${SCOPED_NAME}"
59+
fi
60+
done
61+
62+
- name: Publish packages
63+
env:
64+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
run: |
66+
node ./utils/workspace.js --list-public-package-paths | while read package_path
67+
do
68+
echo "Publishing ${package_path}..."
69+
npm publish "${package_path}" --access=public --tag=latest || echo "Failed to publish ${package_path}, continuing..."
70+
done

0 commit comments

Comments
 (0)