Skip to content

Commit

Permalink
chore: update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
taye committed Mar 28, 2024
1 parent 23e1129 commit c8bfe38
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches:
- main
- next

jobs:
test:
uses: ./.github/workflows/test.yml

publish-npm:
name: '📦 Build and Publish 🚀'
needs: [test]
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
cache: yarn
- name: ⚙ bootstrap
run: 'npm run bootstrap && git fetch --tags'
- name: 📦 build and publish 🚀
run: npx _release
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
23 changes: 1 addition & 22 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Workflow

on:
push:
pull_request:
workflow_dispatch:
workflow_call:

jobs:
test:
Expand All @@ -20,22 +18,3 @@ jobs:
run: npx _lint
- name: 🧪 tests
run: npm test

publish-npm:
name: '📦 Build and Publish 🚀'
if: ${{ github.repository == 'taye/interact.js' && (github.ref_name == 'latest' || github.ref_name == 'next') }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
cache: yarn
- name: ⚙ bootstrap
run: 'npm run bootstrap && git fetch --tags'
- name: 📦 build and publish 🚀
run: npx _release
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit c8bfe38

Please sign in to comment.