Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI scripts #101

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts
- name: Build
run: pnpm run build
- name: Publish to NPM (with provenance)
run: pnpm publish --no-git-checks --access public --tag ${{ github.event.release.prerelease && 'next' || 'latest' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"
9 changes: 5 additions & 4 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Size Limit

on:
pull_request:
branches:
Expand All @@ -15,16 +16,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Fetch Git refs
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- uses: pnpm/action-setup@v2
with:
version: latest
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts
- name: Check size
- name: Check package size
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 12 additions & 7 deletions .github/workflows/main.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Lint
name: Test

on:
push:
branches:
Expand All @@ -7,22 +8,26 @@ on:
branches:
- main

env:
FORCE_COLOR: 2

jobs:
lint:
test:
runs-on: ubuntu-latest
env:
FORCE_COLOR: 2

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts
- name: Lint
run: pnpm lint
# pre-commit dioes this for us
# - name: Lint
# run: pnpm run lint
- name: Build
run: pnpm run build
Loading