-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (81 loc) · 2.17 KB
/
Copy pathpublish.yml
File metadata and controls
90 lines (81 loc) · 2.17 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
name: Publish
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: npm-publish-${{ github.ref }}
cancel-in-progress: false
jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run typecheck
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run lint
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun test
publish:
name: Publish to npm
runs-on: ubuntu-latest
needs:
- typecheck
- lint
- unit-tests
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
- run: npm install -g npm@latest
- run: bun install --frozen-lockfile
- run: bun run ci:version
- name: Read publish version
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- run: bun run build
- run: npm publish
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.version }}
run: |
cat > release-notes.md <<EOF
Published npm version: @prevalentware/opencode-loop-plugin@${VERSION}
Validation:
- Typecheck passed.
- Lint passed.
- Unit tests passed.
- Package published to npm.
EOF
gh release create "v${VERSION}" \
--repo "${GITHUB_REPOSITORY}" \
--target "${GITHUB_SHA}" \
--title "v${VERSION}" \
--notes-file release-notes.md