Skip to content

Commit

Permalink
Merge pull request #30 from sdasda7777/sdasda7777_bundledBuild
Browse files Browse the repository at this point in the history
Added Node CI workflow
  • Loading branch information
sdasda7777 authored Aug 4, 2023
2 parents 51ec524 + ad191b9 commit 9a7182a
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 5 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/nodeci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Node CI

on: [push]

jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get current date
id: get-date
run: |
echo "NOW=$(date +'%Y%m%dT%H%M%S')" >> $GITHUB_ENV
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
- name: Get Version From package.json
id: get-version
uses: beaconbrigade/[email protected]
with:
path: .
- name: Package for Windows
run: |
wget -nv -P .dist/win-x64 https://nodejs.org/download/release/latest/win-x64/node.exe
cp -r * .dist/win-x64/
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: vlc-rpc-v${{steps.get-version.outputs.version}}-nightly${{env.NOW}}-bundled-win-x64
path: |
.dist/win-x64
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: output/test/code-coverage.html
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,5 @@ dist
# TernJS port file
.tern-port

config/config.js
cache/MusicHoardersCache.json
test.js
config/*
cache/*
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"scripts": {
"start": "node ./src/app.js",
"test": "node ./src/test.js",
"run": "npm start"
},
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions src/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

console.log("OK");
10 changes: 8 additions & 2 deletions start.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ if NOT EXIST node_modules (
)
ECHO Modules installed.
)
ECHO Starting script...
CALL npm start

if exist node.exe (
ECHO Detected local Node.js executable, attempting to use it...
CALL node.exe src/app.js
) else (
ECHO Did not detect local Node.js executable, attempting to use `npm`...
CALL npm start
)

if errorlevel 1 (
if "%1" == "--keep-on-error" (
Expand Down

0 comments on commit 9a7182a

Please sign in to comment.