forked from xDarkicex/openclaw-memory-libravdb
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (106 loc) · 4.79 KB
/
Copy pathpublish.yml
File metadata and controls
125 lines (106 loc) · 4.79 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: publish-npm
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
ref:
description: "Git ref to publish (defaults to current ref)"
required: false
type: string
dry_run:
description: "Run a publish dry-run instead of publishing to npm"
required: false
type: boolean
default: true
permissions:
contents: write
packages: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
publish:
name: publish-package
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
steps:
- name: Workflow context
run: |
echo "github.ref=${{ github.ref }}"
echo "github.sha=${{ github.sha }}"
echo "github.workflow_ref=${{ github.workflow_ref }}"
- name: Checkout Plugin (Self)
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || github.ref }}
path: openclaw-memory-libravdb
- name: Checkout Contracts (Public)
uses: actions/checkout@v4
with:
repository: zephyr-systems/libravdb-contracts
ref: main
path: libravdb-contracts
- name: Diagnostic checkout snapshot
run: |
echo "plugin HEAD: $(git -C openclaw-memory-libravdb rev-parse HEAD)"
echo "contracts HEAD: $(git -C libravdb-contracts rev-parse HEAD)"
echo "plugin package.json:"
sed -n '1,80p' openclaw-memory-libravdb/package.json
echo "contracts package.json:"
sed -n '1,80p' libravdb-contracts/package.json
echo "contracts lockfile @types/node hits:"
grep -n '@types/node' libravdb-contracts/pnpm-lock.yaml || true
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
cache-dependency-path: openclaw-memory-libravdb/pnpm-lock.yaml
- name: Install dependencies
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
working-directory: openclaw-memory-libravdb
run: pnpm install --frozen-lockfile
- name: Install dependencies (dry-run)
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
working-directory: openclaw-memory-libravdb
run: pnpm install --no-frozen-lockfile
- name: Install contracts dependencies
working-directory: libravdb-contracts
run: pnpm install --frozen-lockfile
- name: Verify release tag matches package and manifest versions
if: startsWith(github.ref, 'refs/tags/v')
working-directory: openclaw-memory-libravdb
run: |
node -e 'const fs=require("fs"); const pkg=require("./package.json"); const manifest=JSON.parse(fs.readFileSync("./openclaw.plugin.json", "utf8")); const tag=process.env.RELEASE_TAG.replace(/^refs\/tags\/v/,""); if (pkg.version !== tag) { console.error(`package.json version ${pkg.version} does not match release tag ${tag}`); process.exit(1); } if (manifest.version !== tag) { console.error(`openclaw.plugin.json version ${manifest.version} does not match openclaw.plugin.json version ${tag}`); process.exit(1); } if (manifest.version !== pkg.version) { console.error(`openclaw.plugin.json version ${manifest.version} does not match package.json version ${pkg.version}`); process.exit(1); }'
env:
RELEASE_TAG: ${{ github.ref }}
- name: Verify published package contents
working-directory: openclaw-memory-libravdb
run: npm pack --dry-run
- name: Verify npm authentication
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
working-directory: openclaw-memory-libravdb
run: npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Dry-run publish package
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
working-directory: openclaw-memory-libravdb
run: npm publish --access public --dry-run
- name: Publish package
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
working-directory: openclaw-memory-libravdb
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Verify package is visible on npm
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
working-directory: openclaw-memory-libravdb
run: npm view @xdarkicex/openclaw-memory-libravdb version