Skip to content

Commit

Permalink
added workflow + esm only
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtito committed Dec 4, 2023
1 parent f0b3c54 commit 78dbb6f
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"📚 documentation":
- any: ["docs/**", "!docs/**/package.json"]

"playground":
- any: ["playground/**", "!playground/**/package.json"]
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: ci

on:
pull_request:
branches: ["*"]
push:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Build
run: pnpm build

lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Lint
run: pnpm lint

format:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Format
run: pnpm format:check

typecheck:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Typecheck
run: pnpm typecheck
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release
on:
push:
branches:
- main

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use PNPM
uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install deps (with cache)
run: pnpm install

- name: Check packages for common errors
run: pnpm turbo --filter "./packages/*" build lint typecheck

- name: Create release
run: pnpm publish packages/newtonxr --dry-run --no-git-checks --access restricted --tag alpha
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Prevent pnpm from adding the "workspace:"" prefix to local
# packages as it casues issues with manypkg
# @link https://pnpm.io/npmrc#prefer-workspace-packages
save-workspace-protocol=false
prefer-workspace-packages=true

engine-strict=true
2 changes: 1 addition & 1 deletion packages/newtonxr/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig((opts) => ({
entry: ["./src/**/*"],
dts: true,
format: ["esm", "cjs"],
format: ["esm"],
clean: !opts.watch,
esbuildOptions: (option) => {
option.banner = {
Expand Down

0 comments on commit 78dbb6f

Please sign in to comment.