-
Notifications
You must be signed in to change notification settings - Fork 201
72 lines (64 loc) · 2.43 KB
/
sentry.yml
File metadata and controls
72 lines (64 loc) · 2.43 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
name: New Sentry Release
on:
pull_request:
branches: [main]
types: [closed]
jobs:
release:
# Only run for merged release PRs (title contains version like "chore: release v1.977.0")
if: github.event.pull_request.merged == true && contains(github.event.pull_request.title, 'release v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
run: corepack enable && corepack prepare [email protected] --activate
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-modules-
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Extract Version
id: version
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# Extract version from PR title (e.g., "chore: release v1.971.0" -> "1.971.0")
# Fallback to git tag for consistency with deployed version
if [[ "$PR_TITLE" =~ v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
VERSION="${BASH_REMATCH[1]}"
else
# Use git tag to match deployed version
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [[ "$TAG" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
VERSION="${BASH_REMATCH[1]}"
else
VERSION="${{ github.event.pull_request.merge_commit_sha }}"
VERSION="${VERSION:0:7}"
fi
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build Web
run: MODE=production DEPLOY=true VITE_VERSION=${{ steps.version.outputs.version }} pnpm run build:web
- name: Sentry Release
uses: getsentry/action-release@v3
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
# Must match SDK format: shapeshift-web@{version}
version: shapeshift-web@${{ steps.version.outputs.version }}
sourcemaps: ./build
ignore_missing: true