-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (50 loc) · 1.47 KB
/
release-cli.yml
File metadata and controls
62 lines (50 loc) · 1.47 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
name: Release CLI
on:
push:
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: release-cli-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
id-token: write
jobs:
publish-cli:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm -r test:run
- name: Build all packages
run: pnpm -r build
- name: Determine npm tag
id: npm-tag
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
if [[ "$VERSION" == *"beta"* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"alpha"* ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"rc"* ]]; then
echo "tag=rc" >> $GITHUB_OUTPUT
else
echo "tag=latest" >> $GITHUB_OUTPUT
fi
echo "Publishing with tag: $(cat $GITHUB_OUTPUT | grep tag | cut -d= -f2)"
- name: Publish ccem (CLI)
run: pnpm --filter ccem publish --no-git-checks --tag ${{ steps.npm-tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}