Skip to content

Commit

Permalink
testing building in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Jun 10, 2024
1 parent edc0815 commit 347b3f9
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# test
name: Publish package to GitHub Packages
on:
push:

jobs:
linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: bash package-linux_x64.sh
- name: Upload math result for job Linux
uses: actions/upload-artifact@v3
with:
name: linux-lib
path: release/*

windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: ilammy/msvc-dev-cmd@v1
- uses: microsoft/[email protected]
- name: Build
run: bash package-windows_x86_64.sh
- name: Upload math result for job Windows
uses: actions/upload-artifact@v3
with:
name: win-lib
path: release/*
macos-arm:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: bash package-macos.sh
- name: Upload math result for job Mac
uses: actions/upload-artifact@v3
with:
name: mac-lib-arm
path: release/*
macos:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: bash package-macos.sh
- name: Upload math result for job Mac
uses: actions/upload-artifact@v3
with:
name: mac-lib-x86
path: release/*

Binary file added MacIconSourceImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion package-linux_x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ $JAVA_HOME/bin/jpackage --input $BUILDDIR \
--linux-shortcut \
--icon $ICON \
--copyright "Creative Commons" \
--vendor CommonWealthRobotics
--vendor CommonWealthRobotics \
--linux-menu-group=Education;Graphics;Development; \
--java-options '--enable-preview'
echo "Deb built!"
ls -al
rm -rf release
mkdir release
cp *.deb release/
cp *.AppImage release/
#sudo apt remove bowlerlauncher
#sudo dpkg -i *.deb

Expand Down
69 changes: 69 additions & 0 deletions package-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#https://cdn.azul.com/zulu/bin/zulu17.50.19-ca-fx-jdk17.0.11-macosx_x64.tar.gz
NAME=BowlerLauncher
VERSION=1.0.1
MAIN=com.commonwealthrobotics.HatRackMain

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ARCH=x86_64
JVM=zulu17.50.19-ca-fx-jdk17.0.11-macosx_x64
if [[ $(uname -m) == 'arm64' ]]; then
ARCH=arm46
echo "M1 Mac detected https://cdn.azul.com/zulu/bin/zulu17.50.19-ca-fx-jdk17.0.11-macosx_aarch64.tar.gz"
JVM=zulu17.50.19-ca-fx-jdk17.0.11-macosx_aarch64
else
echo "x86 Mac detected https://cdn.azul.com/zulu/bin/zulu17.50.19-ca-fx-jdk17.0.11-macosx_x64.tar.gz"

fi
set -e
ZIP=$JVM.tar.gz
export JAVA_HOME=$HOME/bin/java17/
if test -d $JAVA_HOME/$JVM/; then
echo "$JAVA_HOME exists."
else
rm -rf $JAVA_HOME
mkdir -p $JAVA_HOME
curl https://cdn.azul.com/zulu/bin/$ZIP -o $ZIP
tar -xvzf $ZIP -C $JAVA_HOME
mv $JAVA_HOME/$JVM/* $JAVA_HOME/
fi

./gradlew jar


ICON=$NAME.png
cp BowlerStudioIcon.png $ICON
rm -rf $SCRIPT_DIR/$NAME
rm -rf $SCRIPT_DIR/$NAME.AppDir
BUILDDIR=lib/build/libs/
TARGETJAR=lib.jar
rm -rf *.dmg
echo "Building DMG..."
MACIMAGE=MacIconSourceImage.png
mkdir $NAME.iconset
sips -z 16 16 $MACIMAGE --out $NAME.iconset/icon_16x16.png
sips -z 32 32 $MACIMAGE --out $NAME.iconset/[email protected]
sips -z 32 32 $MACIMAGE --out $NAME.iconset/icon_32x32.png
sips -z 64 64 $MACIMAGE --out $NAME.iconset/[email protected]
sips -z 128 128 $MACIMAGE --out $NAME.iconset/icon_128x128.png
sips -z 256 256 $MACIMAGE --out $NAME.iconset/[email protected]
sips -z 256 256 $MACIMAGE --out $NAME.iconset/icon_256x256.png
sips -z 512 512 $MACIMAGE --out $NAME.iconset/[email protected]
sips -z 512 512 $MACIMAGE --out $NAME.iconset/icon_512x512.png
cp $MACIMAGE $NAME.iconset/[email protected]
iconutil -c icns $NAME.iconset
rm -R $NAME.iconset

$JAVA_HOME/bin/jpackage --input $BUILDDIR \
--name $NAME \
--main-jar $TARGETJAR \
--main-class $MAIN \
--type dmg \
--copyright "Creative Commons" \
--vendor "Common Wealth Robotics" \
--icon $NAME.icns \
--app-version "$VERSION" \
--java-options '--enable-preview'
ls -al
rm -rf release
mkdir release
mv *.dmg release/
7 changes: 6 additions & 1 deletion package-windows_x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ $PACKAGE --input "$INPUT_DIR/" \
--win-menu \
--win-dir-chooser \
--win-per-user-install \
--java-options '--enable-preview'
--java-options '--enable-preview'
ls -al
rm -rf release
mkdir release
cp *.exe release/
cp *.zip release/

0 comments on commit 347b3f9

Please sign in to comment.