KitsuneOffline/.github/workflows/buildnw.yml
2021-08-15 11:14:07 -04:00

64 lines
2.3 KiB
YAML

name: Build NW.js apps
on:
[push, workflow_dispatch]
jobs:
build:
name: Build NW.js apps
runs-on: ubuntu-latest
steps:
- name: Get repository code
uses: actions/checkout@v2
- name: Create build directory
run: mkdir build
- name: Download Windows NW.js
run: wget https://dl.nwjs.io/v0.55.0/nwjs-v0.55.0-win-x64.zip
- name: Extract Windows NW.js
run: unzip nwjs-v0.55.0-win-x64.zip
- name: Download Linux NW.js
run: wget https://dl.nwjs.io/v0.55.0/nwjs-v0.55.0-linux-x64.tar.gz
- name: Extract Linux NW.js
run: tar -xvf nwjs-v0.55.0-linux-x64.tar.gz
- name: Delete archives
run: rm nwjs-v0.55.0-linux-x64.tar.gz nwjs-v0.55.0-win-x64.zip
- name: Rename and move NW.js directories
run: mv nwjs-v0.55.0-linux-x64 build/KitsuneOffline-linux && mv nwjs-v0.55.0-win-x64 build/KitsuneOffline-win
- name: List files to make sure we are on the right track, which we should be!
run: echo "Build directory:" && ls -A build && echo "Repository:" && ls -A
- name: Create package.nw directories
run: mkdir build/KitsuneOffline-linux/package.nw && mkdir build/KitsuneOffline-win/package.nw
- name: Copy code to NW.js directories
run: cp -r logos build/KitsuneOffline-linux/package.nw && cp package.json build/KitsuneOffline-linux/package.nw && cp -r logos build/KitsuneOffline-win/package.nw && cp package.json build/KitsuneOffline-win/package.nw
- name: create Windows archive
run: cd build && zip -r KitsuneOffline-win.zip KitsuneOffline-win
- name: create Linux archive
run: cd build && tar -czvf KitsuneOffline-linux.tar.gz KitsuneOffline-linux
- name: list files again
run: echo "Build directory:" && ls -A build && echo "Repository:" && ls -A
- name: Upload Windows build
uses: actions/upload-artifact@v2
with:
name: KitsuneOffline-win.zip
path: build/KitsuneOffline-win.zip
- name: Upload Linux build
uses: actions/upload-artifact@v2
with:
name: KitsuneOffline-linux.tar.gz
path: build/KitsuneOffline-linux.tar.gz