Skip to content

Commit

Permalink
test: check soruce map workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
imnaiyar committed Jul 16, 2024
1 parent cb945ba commit 2fa7037
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 22 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/upload-source-map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Upload Source Maps

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "16" # Specify your Node.js version

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Install Sentry CLI
run: npm install -g @sentry/cli

- name: Inject id
run: sentry-cli sourcemaps inject dist

- name: Upload source maps to Sentry
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_URL: https://sentry.io/ # Change if you're using a self-hosted Sentry instance
run: |
sentry-cli sourcemaps upload ./dist -o $SENTRY_ORG -p $SENTRY_PROJECT
24 changes: 2 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,6 @@ const client = new SkyHelper();
import { Dashboard } from "../dashboard/main.js";
import chalk from "chalk";

declare global {
namespace NodeJS {
interface Process {
isBun?: boolean;
}
interface ProcessEnv {
TOKEN: string;
NODE_ENV: "development" | "production";
MONGO_CONNECTION: string;
SENTRY_DSN: string;
AUTH_TOKEN: string;
TOPGG_TOKEN?: string;
GUILD?: string;
ERROR_LOGS?: string;
READY_LOGS?: string;
SUGGESTION?: string;
CONTACT_US?: string;
COMMANDS_USED?: string;
BUG_REPORTS?: string;
}
}
}
// Init Sentry
Sentry.init({
dsn: process.env.SENTRY_DSN,
Expand All @@ -38,6 +16,8 @@ Sentry.init({
root: global.__dirname,
}),
],
environment: process.env.NODE_ENV,

// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions

Expand Down
22 changes: 22 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
declare global {
namespace NodeJS {
interface Process {
isBun?: boolean;
}
interface ProcessEnv {
TOKEN: string;
NODE_ENV: "development" | "production";
MONGO_CONNECTION: string;
SENTRY_DSN: string;
AUTH_TOKEN: string;
TOPGG_TOKEN?: string;
GUILD?: string;
ERROR_LOGS?: string;
READY_LOGS?: string;
SUGGESTION?: string;
CONTACT_US?: string;
COMMANDS_USED?: string;
BUG_REPORTS?: string;
}
}
}

0 comments on commit 2fa7037

Please sign in to comment.