-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.41 KB
/
release.yml
File metadata and controls
53 lines (46 loc) · 1.41 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
name: Release
on:
push:
branches: [main]
paths: [package.json]
permissions:
contents: write
id-token: write
jobs:
release:
name: Tag & Publish
runs-on: ubuntu-latest
environment: npm
env:
NPM_CONFIG_AUDIT: "false"
NPM_CONFIG_FUND: "false"
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"
- run: bun install
- name: Check if version changed
id: version
run: |
LOCAL=$(node -p "require('./package.json').version")
REMOTE=$(npm view @arcadeai/create-agent version 2>/dev/null || echo "0.0.0")
echo "local=$LOCAL" >> "$GITHUB_OUTPUT"
if [ "$LOCAL" != "$REMOTE" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Build
if: steps.version.outputs.changed == 'true'
run: npm run build
- name: Publish to npm
if: steps.version.outputs.changed == 'true'
run: npm publish --access public --provenance
- name: Create GitHub Release
if: steps.version.outputs.changed == 'true'
run: gh release create "v${{ steps.version.outputs.local }}" --generate-notes
env:
GH_TOKEN: ${{ github.token }}