Skip to content

Commit

Permalink
feat: add build.yaml and release.yaml.
Browse files Browse the repository at this point in the history
  • Loading branch information
susumuota committed Apr 2, 2023
1 parent 32f7af0 commit d1fc2eb
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build

on:
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.15.0]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run test
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.15.0]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm run test
- run: npm run pack
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: softprops/action-gh-release@v1
with:
draft: true
files: |
*.tgz
*.zip
permissions:
contents: write
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"scripts": {
"build": "tsc && vite build",
"watch": "concurrently \"tsc --watch\" \"vite build --watch\"",
"test": "vitest"
"test": "vitest",
"pack": "rm -f *.tgz *.zip ; npm pack ; tar tfz *.tgz | sed -e 's|^package/||' | zip -r@ `ls *.tgz | sed -e 's|\\.tgz|\\.zip|'`"
},
"devDependencies": {
"@tsconfig/esm": "^1.0.2",
Expand Down

0 comments on commit d1fc2eb

Please sign in to comment.