Skip to content

Commit

Permalink
feat: split test and publish into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanTurnock authored Jan 9, 2024
1 parent 1e38079 commit 5a07b4c
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Lerna Publish
name: Lerna Workflow

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

jobs:
build-and-publish:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
# - uses: leafo/gh-actions-lua@v10.0.0
# with:
# luaVersion: 5.1
- name: Install Lua and LuaRocks
run: |
sudo apt-get update
Expand All @@ -28,7 +25,18 @@ jobs:
run: sudo luarocks install luasocket
- run: npm ci
- run: npm test
- run: |

publish:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Set Git Config
run: |
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
- run: npm run publish
Expand Down

0 comments on commit 5a07b4c

Please sign in to comment.