Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
catdev2024 committed Oct 18, 2024
1 parent be8f322 commit 5eb4f76
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI Test

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Prepare git
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Yarn install
run: yarn
- name: Run test
run: turbo test
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

name: Publish to NPM

jobs:
build:
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- name: Prepare git
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Yarn Install
run: yarn
- name: Run test
run: turbo test
- name: Verify Versions
run: node -e "if ('refs/tags/v' + require('./package.json').version !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + require('./package.json').version, '${{ github.ref }}'); throw Error('Version Mismatch')} "
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_CAT }}

0 comments on commit 5eb4f76

Please sign in to comment.