Browse Source

Github Actions: Build the SDK and then trigger a nightly/nbm rebuild on https://github.com/jMonkeyEngine/sdk-update-center.

MeFisto94 5 years ago
parent
commit
9f53051187
1 changed files with 49 additions and 0 deletions
  1. 49 0
      .github/workflows/gradle.yml

+ 49 - 0
.github/workflows/gradle.yml

@@ -0,0 +1,49 @@
+# This Action will build the SDK and if this succeeds, trigger a build on the
+# jMonkeyEngine/sdk-update-center repository, so that nbms get built and
+# deployed
+name: Nightly NBM Deployment
+
+on:
+  push:
+    branches: [ master ]
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up JDK 11
+      uses: actions/setup-java@v1
+      with:
+        java-version: 11
+
+    - name: Grant execute permission for the scripts
+      run: chmod +x gradlew *.sh
+      
+    - name: Download the Engine
+      run: ./build_engine.sh
+      
+    - name: Fix the Engine
+      run: ./fix_engine.sh
+      
+    - name: Build the Engine
+      run: ./gradlew buildSdk
+    
+    - name: Checkout the nightly-trigger repository
+      uses: actions/checkout@v2
+      with:
+        repository: 'jMonkeyEngine/sdk-update-center'
+        ref: nightly
+        path: nightly
+        token: ${{ secrets.NBM_SIGN_PASS }}
+      
+    - name: Setup Git for the commit
+      run: git config user.email [email protected] && git config user.name MeFisto94
+      working-directory: nightly
+      
+    - name: Overwrite the target file
+      run: rm -rf nightly/target && echo 'echo "::set-env name=sdk_sha::${{ github.sha }}"' > nightly/target
+      
+    - name: Trigger nightly builds
+      working-directory: nightly
+      run: git add target && git commit -m "Trigger a fresh nightly build for https://github.com/jMonkeyEngine/sdk/commit/${{ github.sha }}" && git push