Skip to content

Commit

Permalink
Build executable for linux
Browse files Browse the repository at this point in the history
The AppImage didn't work for me. However, the .deb seems to install
as expected.
  • Loading branch information
lucyb committed Jul 12, 2023
1 parent 055771f commit dffb7fb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 8 deletions.
64 changes: 59 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,24 @@ jobs:
sacro-app/package-lock.json
- name: Run tests
run: just test
- name: Build binary
run: just build
- name: Build app
run: just sacro-app/build
- name: Cypress run
uses: cypress-io/github-action@d69252d52b9a31bad4f418f05ba2bc83687a02eb #v5.8.3
with:
start: just run
wait-on: "http://localhost:8000/"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-videos
path: cypress/videos
if-no-files-found: ignore


test-windows:
runs-on: windows-2022
Expand Down Expand Up @@ -86,6 +100,46 @@ jobs:
path: cypress/videos
if-no-files-found: ignore

build-linux:
needs: [check, test-linux]
permissions:
contents: write
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: "opensafely-core/setup-action@v1"
with:
python-version: "3.11"
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: "npm"
cache-dependency-path: |
**/package-lock.json
sacro-app/package-lock.json
# our just setup doesn't make just available on the path
- uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d
- name: Download sample data
run: just test-outputs
- name: Build Python binary
run: just build
- name: Build app
run: |
mkdir sacro-app/dist/@opensafely
just sacro-app/build
- name: Copy built msi
run: cp sacro-app/dist/@opensafely/sacro*.deb .
- name: Upload build
if: success()
uses: actions/upload-artifact@v3
with:
name: SACRO-latest-linux-build
path: |
sacro*.deb
outputs/*
!outputs/.keep
build-windows:
needs: [check, test-windows]
permissions:
Expand All @@ -108,7 +162,7 @@ jobs:
- uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d
- name: Download sample data
run: just test-outputs
- name: Build binary
- name: Build Python binary
run: just build
- name: Build app
run: just sacro-app/build
Expand Down
6 changes: 3 additions & 3 deletions sacro-app/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@opensafely/sacro",
"productName": "SACRO",
"productName": "sacro",
"version": "0.1.0",
"main": "main.js",
"description": "SACRO Output Viewer",
"author": "OpenSAFELY",
"author": "OpenSAFELY <tech@opensafely.org>",
"homepage": "https://github.com/opensafely-core/sacro",
"scripts": {
"dev": "electron . --no-sandbox",
Expand All @@ -29,7 +29,7 @@
]
},
"linux": {
"target": "AppImage",
"target": "deb",
"category": "Science"
},
"extraResources": [
Expand Down

0 comments on commit dffb7fb

Please sign in to comment.