Skip to content

Commit

Permalink
chore: ci for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanssen0 committed Aug 25, 2024
1 parent 591e779 commit 542f023
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build
run: pnpm build:all
43 changes: 43 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release to NPM

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- master

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm build:prepare
- name: Build
run: pnpm build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
title: "chore: bump packages version"
commit: "chore: bump packages version"
version: pnpm run version
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"test": "jest",
"test:cov": "jest --coverage",
"build:prepare": "pnpm -r --filter !./packages/demo --filter !./packages/faucet install",
"build": "pnpm -r --filter !./packages/demo --filter !./packages/faucet run build",
"build:all": "pnpm -r run build",
"lint": "pnpm -r run lint",
"format": "pnpm -r run format",
"sync:config": "pnpm -r --filter !./packages/demo --filter !./packages/faucet -c exec \"cp ../../config/* . && cp ../../config/.* .\"",
Expand Down

0 comments on commit 542f023

Please sign in to comment.