-
Notifications
You must be signed in to change notification settings - Fork 13
85 lines (70 loc) · 2.32 KB
/
Copy pathrelease.yaml
File metadata and controls
85 lines (70 loc) · 2.32 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
name: Release to NPM when a tag is pushed
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Validate Branch 🚨
run: |
# Get the branch name from the tag
BRANCH_NAME=$(git branch -r --contains ${{ github.ref_name }} | grep -E 'origin/(main|release/.*)' | head -1 | sed 's/origin\///')
if [ -z "$BRANCH_NAME" ]; then
echo "❌ Error: Tag ${{ github.ref_name }} was not created from main or a release/* branch"
exit 1
fi
echo "✅ Tag ${{ github.ref_name }} is valid - created from branch: $BRANCH_NAME"
- name: Setup pnpm 9
uses: pnpm/action-setup@v4
with:
version: 9.3.0
- name: Setup Node.js 22.x
uses: actions/setup-node@v2
with:
node-version: 22.x
- name: Install Dependencies 🔧
run: pnpm install
- name: Check the icon map
run: pnpm --filter=@raystack/apsara check:icon-map
- name: Build Step 🔧
env:
CI: ""
run: pnpm run ci:build
- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Bump Package Version
run: node scripts/bump-version.js packages/raystack packages/tools-config
env:
GIT_REFNAME: ${{ github.ref_name }}
- name: Run Release (apsara) 🚀
run: pnpm run release --tag latest
working-directory: ./packages/raystack
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run Release (tools-config) 🚀
run: pnpm run release --tag latest
working-directory: ./packages/tools-config
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Generate GitHub Release Notes 📓
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" \
--repo "$GITHUB_REPOSITORY" \
--generate-notes \
--verify-tag