From 750cce53ac6f810d53dc55ae74c79b2ab6c17dc4 Mon Sep 17 00:00:00 2001 From: Alexis Murzeau Date: Tue, 24 Oct 2023 23:04:26 +0200 Subject: [PATCH 1/3] add github actions builds --- .github/workflows/main.yml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100755 index 0000000..8c0a135 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,57 @@ +# Workflow to build on each commit and create a release on tags + +name: main + +# Controls when the workflow will run +# Triggers the workflow on push or pull request events +on: [push, pull_request, workflow_dispatch] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # Linux and windows build, MacOS build is not supported on a Linux host + linux: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + # Install nodejs + npm + - uses: actions/setup-node@v3 + + + - name: Install wine + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install -y wine wine32 + + # Build the application + - name: Build + run: | + npm install + npm run dist:lin + npm run dist:win + + - name: Upload Built Artifacts + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: "PTree-linux" # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: | + bin/PTree-linux.zip + bin/PTree-windows.zip + + # Uncomment for artifact publishing on tags + # - name: Publish + # uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # files: | + # bin/PTree-linux.zip + # bin/PTree-windows.zip + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 706deef569eee114a0966405231fd7584a4249a8 Mon Sep 17 00:00:00 2001 From: Alexis Murzeau Date: Tue, 24 Oct 2023 23:23:47 +0200 Subject: [PATCH 2/3] dist: build for x64 on linux The ia32 version segfault on amd64 Debian Sid. --- electron-builder.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electron-builder.json b/electron-builder.json index b843932..f80a35d 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -61,7 +61,7 @@ }, "linux": { "icon" : "resources/png/app", - "target" : {"target":"dir", "arch": "ia32"}, + "target" : {"target":"dir", "arch": "x64"}, "extraFiles" : [ {"from": "resources/example.ptree", "to": "example.ptree"}, {"from": "resources/equations.pdf", "to": "equations.pdf"}, diff --git a/package.json b/package.json index 45faeed..d416b40 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "build:lin": "electron-builder --config electron-builder.json --linux --dir", "dist:mac": " electron-builder --config electron-builder.json --mac ; cd bin ; mv PTree.dmg PTree-macos.dmg ; rm -rf mac", "dist:win": " electron-builder --config electron-builder.json --win ; cd bin ; mv win-unpacked PTree ; rm -f PTree-windows.zip ; zip -r -X -y -q PTree-windows.zip PTree/ ; rm -rf PTree", - "dist:lin": " electron-builder --config electron-builder.json --linux ; cd bin ; mv linux-ia32-unpacked PTree ; rm -f PTree-linux.zip ; zip -r -X -y -q PTree-linux.zip PTree/ ; rm -rf PTree", + "dist:lin": " electron-builder --config electron-builder.json --linux ; cd bin ; mv linux-unpacked PTree ; rm -f PTree-linux.zip ; zip -r -X -y -q PTree-linux.zip PTree/ ; rm -rf PTree", "dist:all": " npm run dist:mac && npm run dist:win && npm run dist:lin" }, "repository": { From 332bafdf065d29096a1d9ba3da7208333f7edf58 Mon Sep 17 00:00:00 2001 From: Alexis Murzeau Date: Tue, 24 Oct 2023 23:43:36 +0200 Subject: [PATCH 3/3] fail github build on electron-builder error --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d416b40..eea1177 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ "build:mac": "electron-builder --config electron-builder.json --mac --dir", "build:win": "electron-builder --config electron-builder.json --win --dir", "build:lin": "electron-builder --config electron-builder.json --linux --dir", - "dist:mac": " electron-builder --config electron-builder.json --mac ; cd bin ; mv PTree.dmg PTree-macos.dmg ; rm -rf mac", - "dist:win": " electron-builder --config electron-builder.json --win ; cd bin ; mv win-unpacked PTree ; rm -f PTree-windows.zip ; zip -r -X -y -q PTree-windows.zip PTree/ ; rm -rf PTree", - "dist:lin": " electron-builder --config electron-builder.json --linux ; cd bin ; mv linux-unpacked PTree ; rm -f PTree-linux.zip ; zip -r -X -y -q PTree-linux.zip PTree/ ; rm -rf PTree", + "dist:mac": " electron-builder --config electron-builder.json --mac && cd bin && mv PTree.dmg PTree-macos.dmg && rm -rf mac", + "dist:win": " electron-builder --config electron-builder.json --win && cd bin && mv win-unpacked PTree && rm -f PTree-windows.zip && zip -r -X -y -q PTree-windows.zip PTree/ && rm -rf PTree", + "dist:lin": " electron-builder --config electron-builder.json --linux && cd bin && mv linux-unpacked PTree && rm -f PTree-linux.zip && zip -r -X -y -q PTree-linux.zip PTree/ && rm -rf PTree", "dist:all": " npm run dist:mac && npm run dist:win && npm run dist:lin" }, "repository": {