Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
ci(craft): setup build (#30)
Browse files Browse the repository at this point in the history
* fix(craft): add gh provider

* fix(ci): move bindings so they are easier to pack

* fix(ci): move bindings so they are easier to pack
  • Loading branch information
JonasBa authored Sep 29, 2022
1 parent 29e8c34 commit e394f4b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ changelogPolicy: auto
targets:
- name: npm
access: public
- name: github
tagPrefix: v
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Build & Test'
on:
push:
branches:
- 'release/*'
pull_request:
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
jobs:
artifacts:
name: Upload Artifacts
needs: [build]
runs-on: ubuntu-latest
# Build artifacts are only needed for releasing workflow.
if: startsWith(github.ref, 'refs/heads/release/')
steps:
- name: Check out current commit
uses: actions/checkout@v3
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Lint,
run: npm run lint
- name: Test
run: npm run test
- name: build
run: npm run build:lib
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
4 changes: 2 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"targets": [
{
"target_name": "cpu_profiler",
"sources": [ "src/bindings/cpu_profiler.cc" ],
"sources": [ "bindings/cpu_profiler.cc" ],
"defines": ["PROFILER_FORMAT=FORMAT_SAMPLED"],
'include_dirs': [
'<!(node -e "require(\'nan\')")'
]
},
# {
# "target_name": "cpu_profiler_format_benchmark",
# "sources": [ "src/bindings/cpu_profiler.cc" ],
# "sources": [ "bindings/cpu_profiler.cc" ],
# "defines": ["FORMAT_BENCHMARK=1"],
# 'include_dirs': [
# '<!(node -e "require(\'nan\')")'
Expand Down
File renamed without changes.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"name": "@sentry/profiling-node",
"version": "0.0.0-alpha",
"description": "Sampling based nodejs profiler.",
"main": "./lib/index.js",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"engines": {
"node": ">=12.0.0"
},
"files": [
"lib/**/*"
"lib",
"binding.gyp",
"bindings",
"README.md",
"package.json",
"package-lock.json"
],
"scripts": {
"postinstall": "npm run build:bindings",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CpuProfilerBindings } from '../cpu_profiler';
import type { ThreadCpuProfile } from '../cpu_profiler';
import { CpuProfilerBindings } from './cpu_profiler';
import type { ThreadCpuProfile } from './cpu_profiler';

const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
const profiled = (name: string, fn: () => void) => {
Expand Down

0 comments on commit e394f4b

Please sign in to comment.