Skip to content

Commit

Permalink
Try making release that includes Windows and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohns committed Oct 22, 2024
1 parent 8675a8f commit 19dabe3
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 22 deletions.
125 changes: 109 additions & 16 deletions .github/workflows/build_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Build App
on:
push:
branches:
- master
- [master, feature/LinuxCiBuild]

concurrency: ci-${{ github.ref }}

jobs:

build-app:
build-win:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
Expand Down Expand Up @@ -133,21 +133,29 @@ jobs:
ref: bleeding-edge
description: Latest successful automated build

- name: Create Release
uses: ncipollo/[email protected]
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
id: artifact-windows-upload-step
with:
artifacts: '${{runner.temp}}\build_${{ runner.os }}_wx_app\InterSpec_app_${{ runner.os }}_WebView_latest*.zip'
draft: false
prerelease: true
body: "An automated, and untested build of the latest code pushed to the repository. Requires Windows 10, or may work on Windows 7 with the Edge browser runtime installed."
allowUpdates: true
generateReleaseNotes: false
name: "Development Build"
removeArtifacts: true
replacesArtifacts: true
tag: 'bleeding-edge'
commit: ${{ github.sha }}
makeLatest: true
name: windows-build
overwrite: true
path: '${{runner.temp}}\build_${{ runner.os }}_wx_app\InterSpec_app_${{ runner.os }}_WebView_latest*.zip'

# - name: Create Release
# uses: ncipollo/[email protected]
# with:
# artifacts: '${{runner.temp}}\build_${{ runner.os }}_wx_app\InterSpec_app_${{ runner.os }}_WebView_latest*.zip'
# draft: false
# prerelease: true
# body: "An automated, and untested build of the latest code pushed to the repository. Requires Windows 10, or may work on Windows 7 with the Edge browser runtime installed."
# allowUpdates: true
# generateReleaseNotes: false
# name: "Development Build"
# removeArtifacts: true
# replacesArtifacts: true
# tag: 'bleeding-edge'
# commit: ${{ github.sha }}
# makeLatest: true


- name: "Cleanup and finish"
Expand All @@ -156,4 +164,89 @@ jobs:
echo "Job status is ${{ job.status }}."
build-linux:
runs-on: ubuntu-latest # Use the latest Ubuntu environment

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/InterSpec_code
submodules: true # Recursively checkout submodules

- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ${{runner.temp}}/build_linux_working_dir
key: ${{ runner.os }}-build-npm-${{ hashFiles('target/electron/package.json') }}
restore-keys: |
${{ runner.os }}-build-npm-
- name: Cache c++ dependencies
uses: actions/cache@v3
with:
path: ${{runner.temp}}/build_linux_electron
key: ${{ runner.os }}-build-cpp-${{ hashFiles('cmake/FetchInterSpecDeps.txt') }}
restore-keys: |
${{ runner.os }}-build-cpp-
- name: Make build directories
shell: bash
working-directory: ${{runner.temp}}
run: |
mkdir -p build_linux_electron
mkdir -p build_linux_working_dir
- name: Configure and build in Docker
uses: addnab/docker-run-action@v3
env:
LEAFLET_KEY: ${{ secrets.LEAFLET_KEY }}
with:
image: quay.io/pypa/manylinux_2_28_x86_64
shell: bash
options: --name manylinux-container -v ${{ github.workspace }}/InterSpec_code:/interspec -v ${{runner.temp}}/build_linux_electron/:/build_app -v ${{runner.temp}}/build_linux_working_dir:/build_working_dir -e LEAFLET_KEY=${{ secrets.LEAFLET_KEY }}
run: |
echo "Running Script from within docker"
/interspec/target/electron/build_linux_app_from_docker.sh /interspec /build_app /build_working_dir
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
id: artifact-linux-upload-step
with:
name: linux-build
overwrite: true
path: ${{runner.temp}}/build_linux_working_dir/InterSpec_app_Linux_Electron_latest_*.zip

release:
runs-on: ubuntu-latest
needs: [build-linux, build-win]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
pattern: *-build
path: ./artifacts
merge-multiple: true

- name: Display structure of downloaded files
run: ls -R

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
tag_name: bleeding-edge
release_name: "Development Build"
body: "An automated, and untested build of the latest code pushed to the repository. Requires Windows 10, or may work on Windows 7 with the Edge browser runtime installed."
draft: false
prerelease: true
generate_release_notes: false
prerelease: true
make_latest: true
files: ./artifacts/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions target/electron/build_linux_app_from_docker.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

#handle_error() {
# echo "An error occurred on line $1"
# exit 1
#}
#trap 'handle_error $LINENO' ERR
handle_error() {
echo "An error occurred building InterSpec, on line $1"
exit 1
}
trap 'handle_error $LINENO' ERR

# set -e # Cause script to exit as soon as there is an error

Expand Down
2 changes: 1 addition & 1 deletion target/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "InterSpecAddOn",
"version": "1.0.12",
"version": "1.0.13",
"description": "Application for interactive gamma spectroscopy",
"homepage": "https://github.com/sandialabs/InterSpec",
"main": "main.js",
Expand Down

0 comments on commit 19dabe3

Please sign in to comment.