Repository navigation
71 lines (56 loc) · 1.72 KB
/
Copy pathpublish.yml
File metadata and controls
71 lines (56 loc) · 1.72 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
name: Publish package
on:
push:
tags:
- "v*"
permissions:
contents: read
id-token: write
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
- name: Verify release tag
run: |
package_version="$(node -p "require('./package.json').version")"
test "${GITHUB_REF_NAME}" = "v${package_version}"
test "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run release checks
run: bun run check
- name: Check out compatible OpenCode host
uses: actions/checkout@v6
with:
repository: neriousy/opencode
ref: 06e26d89ad0b06663fc4b34241f8661d170c2450
path: .release/opencode
persist-credentials: false
- name: Install OpenCode host dependencies
working-directory: .release/opencode
run: bun install --frozen-lockfile
- name: Verify packed package
run: bun run test:packed
env:
OPENCODE_REPO: ${{ github.workspace }}/.release/opencode
- name: Remove compatible OpenCode host
run: rm -rf "${GITHUB_WORKSPACE}/.release"
- name: Publish to npm
run: npm publish