Browse Source

Add support for nightly builds via GitHub Actions

Jens Fischer 5 năm trước cách đây
mục cha
commit
dfd974891a
2 tập tin đã thay đổi với 76 bổ sung6 xóa
  1. 63 0
      .github/workflows/main.yml
  2. 13 6
      README.md

+ 63 - 0
.github/workflows/main.yml

@@ -0,0 +1,63 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    env:
+      nwjs-version: v0.45.1
+    steps:
+    - uses: actions/checkout@v2
+    - uses: krdlab/setup-haxe@v1
+    - name: Build
+      run: |
+        haxelib git heaps https://github.com/HeapsIO/heaps
+        haxelib git castle https://github.com/ncannasse/castle
+        haxelib git hxbit https://github.com/ncannasse/hxbit
+        haxelib git hscript https://github.com/HaxeFoundation/hscript
+        haxelib git hxnodejs https://github.com/HaxeFoundation/hxnodejs
+        haxelib git domkit https://github.com/HeapsIO/domkit
+        haxelib git hx3compat https://github.com/HaxeFoundation/hx3compat
+        haxe hide.hxml
+    - run: sudo apt-get install p7zip-full
+    - name: Windows
+      run: |
+        wget -O nwjs-win.zip https://dl.nwjs.io/${{env.nwjs-version}}/nwjs-sdk-${{env.nwjs-version}}-win-x64.zip
+        unzip nwjs-win.zip
+        mkdir -p zips
+        cp -r bin zips/windows
+        cp -r nwjs-sdk-${{env.nwjs-version}}-win-x64 zips/windows/nwjs
+        cd zips/windows
+        7z a -mm=Deflate -mx=9 ../windows.zip *
+        cd ../..
+        rm -rf zips/windows
+    - name: Linux
+      run: |
+        wget -O nwjs-linux.tar.gz https://dl.nwjs.io/${{env.nwjs-version}}/nwjs-sdk-${{env.nwjs-version}}-linux-x64.tar.gz
+        tar -xvzf nwjs-linux.tar.gz
+        mkdir -p zips
+        cp -r bin zips/linux
+        cp -r nwjs-sdk-${{env.nwjs-version}}-linux-x64 zips/linux/nwjs
+        cd zips/linux
+        7z a -mm=Deflate -mx=9 ../linux.zip *
+        cd ../..
+        rm -rf zips/linux
+    - name: Mac
+      run: |
+        wget -O nwjs-mac.zip https://dl.nwjs.io/${{env.nwjs-version}}/nwjs-sdk-${{env.nwjs-version}}-osx-x64.zip
+        unzip nwjs-mac.zip
+        mkdir -p zips/mac
+        cp -r nwjs-sdk-${{env.nwjs-version}}-osx-x64/nwjs.app zips/mac/nwjs.app
+        cp -r bin zips/mac/nwjs.app/Contents/Resources/app.nw
+        cd zips/mac
+        7z a -mm=Deflate -mx=9 ../mac.zip *
+        cd ../..
+        rm -rf zips/mac
+    - name: Deploy
+      run: |
+        mkdir ~/.ssh
+        echo "${{secrets.DEPLOY_KEY}}" > ~/.ssh/id_rsa
+        chmod 600 ~/.ssh/id_rsa
+        scp -o StrictHostKeyChecking=no zips/* [email protected]:hide-builds
+      if: github.event_name == 'push' && github.ref == 'refs/heads/master'

+ 13 - 6
README.md

@@ -1,5 +1,7 @@
 # Hide
 
+[![CI](https://img.shields.io/github/workflow/status/HeapsIO/hide/CI.svg?logo=github)](https://github.com/HeapsIO/hide/actions?query=workflow%3ACI)
+
 ![image](https://haxe.org/img/blog/2020-04-06-shirogames-stack/hide.png)
 
 Hide (Heaps IDE) is an extensible editor that can be used as a middleware for various tasks, such as:
@@ -12,6 +14,9 @@ Hide (Heaps IDE) is an extensible editor that can be used as a middleware for va
 - extend by adding game specific prefabs
 - extend with your own game specific editors
 
+## Nightly builds
+
+If you don't want to build Hide from source, you can download a nightly build from [here](http://37.187.145.134:8080/hide-builds/).
 
 ## Compiling from source
 #### 1. Install Prerequisites
@@ -33,13 +38,15 @@ haxelib git hx3compat https://github.com/HaxeFoundation/hx3compat
 - This will create hide.js in the bin folder
 - If there are errors when compiling, make sure you are using the latest libraries from git
 
-#### 3. Run with NWJS
-- Download and copy [NWJS](https://nwjs.io/) into the /bin/nwjs directory
-- Build with `haxe hide.hxml -cmd bin/hide.cmd`
-    - Windows: Run hide.cmd
-    - Linux: Run nwjs/nwjs from bin directory
-    - OSX: Copy all files from bin into bin/nwjs.app/Contents/Resources/app.nw folder, then open the NWJS application
+#### 3. Install NWJS
+- Download and copy [NWJS](https://nwjs.io/) into the `/bin/nwjs` directory
+- On OSX, copy all files from `bin` into the `bin/nwjs.app/Contents/Resources/app.nw` folder
+
+## Running
 
+- Windows: Run `hide.cmd`
+- Linux: Run `nwjs/nwjs`
+- OSX: Open the NWJS application
 
 ## Configuration