Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: split test and publish into 2 #2

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -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