Fixed issues on Linux, added Linux workflow steps (#41) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node CI - main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_test_and_nightly: | |
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: | | |
mkdir -p .dist/zipped/ | |
mkdir -p .dist/win-x64/ | |
cp -rv * .dist/win-x64/ | |
wget -P .dist/win-x64 https://nodejs.org/download/release/latest/win-x64/node.exe | |
zip -r .dist/zipped/vlc-rpc-v${{steps.get-version.outputs.version}}-nightly${{env.NOW}}-bundled-win-x64.zip .dist/win-x64 | |
- name: Package for Linux | |
run: | | |
mkdir -p .dist/zipped/ | |
mkdir -p .dist/linux-x64/ | |
mkdir -p .help/linux-x64/node | |
cp -rv * .dist/linux-x64/ | |
wget -P .help/linux-x64 https://nodejs.org/download/release/latest/node-v21.1.0-linux-x64.tar.gz | |
tar -zxvf .help/linux-x64/node-v21.1.0-linux-x64.tar.gz -C .help/linux-x64/node | |
cp -rv .help/linux-x64/node/**/bin/node .dist/linux-x64/ | |
zip -r .dist/zipped/vlc-rpc-v${{steps.get-version.outputs.version}}-nightly${{env.NOW}}-bundled-linux-x64.zip .dist/linux-x64 | |
- name: Archive Windows 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 Linux artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vlc-rpc-v${{steps.get-version.outputs.version}}-nightly${{env.NOW}}-bundled-linux-x64 | |
path: | | |
.dist/linux-x64 | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: code-coverage-report | |
path: output/test/code-coverage.html | |
- name: Update nightly release | |
uses: pyTooling/Actions/releaser@main | |
with: | |
tag: nightly | |
rm: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: .dist/zipped/*.zip |