Skip to content

Commit

Permalink
ci(plugin): add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
samcyn committed Apr 1, 2024
1 parent 785f0a2 commit 0172508
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to npm with Yarn

on:
push:
branches:
- release
pull_request:
branches:
- release

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.9.0

- name: Install Yarn
run: npm install -g [email protected]

- name: Install dependencies with Yarn
run: yarn install --frozen-lockfile

- name: Run tests with Yarn
run: yarn test

- name: Publish to npm with Yarn
if: github.event_name == 'push' && github.ref == 'refs/heads/release'
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/update-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to npm with Yarn

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.9.0

- name: Install Yarn
run: npm install -g [email protected]

- name: Install dependencies with Yarn
run: yarn install --frozen-lockfile

- name: Run tests with Yarn
run: yarn test

0 comments on commit 0172508

Please sign in to comment.