Browse Source

Add raspberry pi binary (#3)

Anuj Bansal 3 years ago
parent
commit
4fba814fe1
2 changed files with 41 additions and 4 deletions
  1. 41 2
      .github/workflows/create-release.yml
  2. 0 2
      scripts/raspberry-cross-build.sh

+ 41 - 2
.github/workflows/create-release.yml

@@ -45,9 +45,42 @@ jobs:
           path: joystream-node-macos.tar.gz
           retention-days: 1
 
+  build-rpi-binary:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - id: compute_shasum
+        name: Compute runtime code shasum
+        run: |
+          export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
+          echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
+
+      - name: Run Setup
+        run: |
+          ./setup.sh
+
+      - name: Build binaries
+        run: |
+          export WORKSPACE_ROOT=`cargo metadata --offline --no-deps --format-version 1 | jq .workspace_root -r`
+          sudo chmod a+w $WORKSPACE_ROOT
+          ./scripts/raspberry-cross-build.sh
+
+      - name: Tar the binary
+        run: |
+          tar czvf joystream-node-rpi.tar.gz -C ./target/arm-unknown-linux-gnueabihf/release joystream-node
+
+      - name: Temporarily save node binary
+        uses: actions/upload-artifact@v2
+        with:
+          name: joystream-node-rpi-${{ steps.compute_shasum.outputs.shasum }}
+          path: joystream-node-rpi.tar.gz
+          retention-days: 1
+
   create-release:
     runs-on: ubuntu-latest
-    needs: [build-mac-binary]
+    needs: [build-mac-binary, build-rpi-binary]
     steps:
       - name: Checkout
         uses: actions/checkout@v2
@@ -85,9 +118,15 @@ jobs:
         with:
           name: joystream-node-macos-${{ steps.compute_shasum.outputs.shasum }}
 
-      - name: Rename MacOS tar
+      - name: Retrieve saved RPi binary
+        uses: actions/download-artifact@v2
+        with:
+          name: joystream-node-rpi-${{ steps.compute_shasum.outputs.shasum }}
+
+      - name: Rename MacOS and RPi tar
         run: |
           mv joystream-node-macos.tar.gz joystream-node-${{ github.event.inputs.tag }}-macos.tar.gz
+          mv joystream-node-rpi.tar.gz joystream-node-${{ github.event.inputs.tag }}-rpi.tar.gz
 
       - name: Release
         uses: softprops/action-gh-release@v1

+ 0 - 2
scripts/raspberry-cross-build.sh

@@ -14,5 +14,3 @@ docker run \
     --volume ${HOME}/.cargo/registry:/home/cross/.cargo/registry \
     joystream/rust-raspberry \
     build --release -p joystream-node
-
-ls -l target/arm-unknown-linux-gnueabihf/joystream-node