-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.42 KB
/
Copy pathrelease.yml
File metadata and controls
84 lines (73 loc) · 2.42 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish (for example v0.2.1)'
required: true
type: string
jobs:
release:
name: Publish release assets
runs-on: ubuntu-latest
environment: prod
permissions:
contents: write
id-token: write
env:
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
CHECKOUT_REF: ${{ github.event_name == 'workflow_dispatch' && github.ref_name || github.ref_name }}
CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }}
steps:
- uses: actions/checkout@v6.0.2
with:
ref: ${{ env.CHECKOUT_REF }}
- name: Validate release tag format
run: |
case "$RELEASE_TAG" in
v*) ;;
*) echo "RELEASE_TAG must start with v (got: $RELEASE_TAG)" >&2; exit 1 ;;
esac
- name: Use Node.js 24
uses: actions/setup-node@v6.3.0
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci
- name: Release checks (typecheck + build + test + pack dry-run)
run: bash scripts/release-check.sh
- name: Ensure GitHub release exists
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release view "$RELEASE_TAG" >/dev/null 2>&1 || \
gh release create "$RELEASE_TAG" --generate-notes --title "$RELEASE_TAG"
- name: Publish to npm via trusted publishing
run: npm publish --provenance --access public
- name: Install and authenticate ClaWHub CLI if token exists
run: |
if [ -z "$CLAWHUB_TOKEN" ]; then
echo "CLAWHUB_TOKEN not set, skipping ClaWHub install/login"
exit 0
fi
npm i -g clawhub
clawhub login --token "$CLAWHUB_TOKEN" --no-browser
- name: Publish skill to ClaWHub if token exists
run: |
if [ -z "$CLAWHUB_TOKEN" ]; then
echo "CLAWHUB_TOKEN not set, skipping ClaWHub publish"
exit 0
fi
VERSION="${RELEASE_TAG#v}"
clawhub publish ./skills/agentskill \
--slug daeva \
--name "Daeva" \
--version "$VERSION" \
--changelog "Release $RELEASE_TAG" \
--tags latest \
--no-input