Repository navigation
109 lines (103 loc) · 3.21 KB
/
Copy pathpublish.yml
File metadata and controls
109 lines (103 loc) · 3.21 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
name: Publish package
on:
push:
branches:
- main
tags:
- "v*"
concurrency:
group: publish-package
cancel-in-progress: false
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
state: ${{ steps.release.outputs.state }}
tag: ${{ steps.release.outputs.tag }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- id: release
name: Resolve release state
env:
PUSHED_TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
run: node .agents/skills/codex-kit-release/release.mjs release-state "$PUSHED_TAG" >> "$GITHUB_OUTPUT"
- uses: pnpm/action-setup@v4
if: steps.release.outputs.state != 'skip'
with:
version: 11.5.2
- uses: actions/setup-node@v6
if: steps.release.outputs.state != 'skip'
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- if: steps.release.outputs.state != 'skip'
run: npm install --global npm@11.5.1
- if: steps.release.outputs.state != 'skip'
run: pnpm install --frozen-lockfile
- if: steps.release.outputs.state != 'skip'
run: pnpm run typecheck
- if: steps.release.outputs.state != 'skip'
run: pnpm test
- if: steps.release.outputs.state != 'skip'
run: pnpm run pack:check
tag:
needs: prepare
if: needs.prepare.outputs.state != 'skip'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Create release tag
if: needs.prepare.outputs.state == 'new'
env:
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
run: |
git tag "$RELEASE_TAG" "$GITHUB_SHA"
git push origin "refs/tags/$RELEASE_TAG"
publish:
needs: [prepare, tag]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
with:
version: 11.5.2
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- run: npm install --global npm@11.5.1
- run: pnpm install --frozen-lockfile
- name: Publish if absent from npm
env:
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
run: npm view "@iamdevlinph/codex-kit@${RELEASE_TAG#v}" version >/dev/null 2>&1 || npm publish --access public
release:
needs: [prepare, publish]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Create or update GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
run: |
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release edit "$RELEASE_TAG" --title "$RELEASE_TAG" --notes-file RELEASE_NOTES.md
else
gh release create "$RELEASE_TAG" --title "$RELEASE_TAG" --notes-file RELEASE_NOTES.md
fi