Skip to content

Commit

Permalink
feat: first release
Browse files Browse the repository at this point in the history
  • Loading branch information
skarab42 committed Aug 11, 2022
1 parent 9725734 commit cbb91e4
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/test-release.yaml
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14']
name: Test on Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v2.1.0
with:
version: 7.6.0
- run: pnpm install
- run: pnpm build
- run: pnpm test
release:
needs: [test]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14']
name: Release on NPM
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v2.1.0
with:
version: 7.6.0
- run: pnpm install
- run: pnpm build
- run: pnpm release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -2,7 +2,7 @@ node_modules
lib

# remove or comment the following line when you want to publish
.github/workflows/test-release.yaml
# .github/workflows/test-release.yaml

# uncomment the following line when you want to publish
# .github/workflows/test.yaml
.github/workflows/test.yaml
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -17,9 +17,9 @@
"type": "module",
"exports": "./lib/index.js",
"types": "./lib/index.d.ts",
"private": true,
"private": false,
"publishConfig": {
"access": "restricted"
"access": "public"
},
"files": [
"lib"
Expand Down

0 comments on commit cbb91e4

Please sign in to comment.