-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.72 KB
/
Copy pathrelease-node.yml
File metadata and controls
54 lines (52 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
name: Release Node
on:
workflow_dispatch:
push:
branches: [develop]
jobs:
check:
runs-on: ubuntu-latest
outputs:
should-publish: ${{ steps.check.outputs.publish }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v5
- id: check
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "publish=true" >> $GITHUB_OUTPUT
VERSION=$(node -e "console.log(require('./packages/debugger/package.json').version)")
echo "version=$VERSION" >> $GITHUB_OUTPUT
exit 0
fi
COMMITS='${{ toJSON(github.event.commits.*.message) }}'
VERSION=$(echo "$COMMITS" | sed -n 's/.*release(node): v\([0-9.]*\).*/\1/p' | tail -1)
if [[ -n "$VERSION" ]]; then
echo "publish=true" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "publish=false" >> $GITHUB_OUTPUT
fi
publish:
needs: check
if: needs.check.outputs.should-publish == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: bun install
- run: bun run build
- run: npm install -g npm@latest
- run: cd packages/debugger && npm publish --provenance --access public
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: debugger-v${{ needs.check.outputs.version }}
generate_release_notes: true