-
Notifications
You must be signed in to change notification settings - Fork 2.4k
76 lines (66 loc) · 2.38 KB
/
Copy pathpublish-solid.yml
File metadata and controls
76 lines (66 loc) · 2.38 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
name: Publish Solid package
on:
workflow_dispatch:
inputs:
ref:
description: Branch, tag, or commit to publish
required: true
default: main
version:
description: Public version to publish
required: true
default: 0.1.0
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v7
with:
ref: ${{ inputs.ref }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 26.4.0
registry-url: https://registry.npmjs.org
scope: '@ornery'
always-auth: true
cache: npm
cache-dependency-path: |
package-lock.json
projects/ui-grid-solid/package-lock.json
- name: Install repository dependencies
run: npm ci --legacy-peer-deps
- name: Install Solid adapter dependencies
run: npm ci --prefix projects/ui-grid-solid
- name: Verify internal packages are published
run: |
VERSION="${{ inputs.version }}"
npm view "@ornery/ui-grid-core@$VERSION" version
npm view "@ornery/ui-grid-vanilla@$VERSION" version
- name: Build and test the Solid package
run: |
npm run build:solid
npm run test:solid
- name: Set and verify the publish manifest
env:
VERSION: ${{ inputs.version }}
run: |
node - <<'NODE'
const fs = require('node:fs');
const path = './projects/ui-grid-solid/package.json';
const pkg = require(path);
pkg.version = process.env.VERSION;
for (const name of ['@ornery/ui-grid-core', '@ornery/ui-grid-vanilla']) {
pkg.peerDependencies[name] = process.env.VERSION;
}
fs.writeFileSync(path, `${JSON.stringify(pkg, null, 2)}\n`);
if (pkg.version !== process.env.VERSION) throw new Error('Package version was not updated');
for (const name of ['@ornery/ui-grid-core', '@ornery/ui-grid-vanilla']) {
if (pkg.peerDependencies[name] !== process.env.VERSION) throw new Error(`Invalid ${name} peer`);
}
NODE
- name: Publish to npm
run: npm publish ./projects/ui-grid-solid --access public --registry=https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}