diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml new file mode 100644 index 00000000..69b6425d --- /dev/null +++ b/.github/workflows/build_linux.yml @@ -0,0 +1,56 @@ +name: Build Linux Binary + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build-linux-binary: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 22 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'liberica' + cache: maven + + - name: Extract version from Maven cache + id: get-version + run: | + version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ + -Dexpression=project.version -q -DforceStdout --file tcMenuGenerator/pom.xml) + echo "version=$version" >> $GITHUB_ENV + + - name: Build tcMenuGenerator binary + run: | + mvn -B install -DskipTests -Dgpg.skip=true --file tcMenuJavaApi/pom.xml + mvn -B install -DskipTests -Dgpg.skip=true --file embedCONTROLCore/pom.xml + mvn -B install -DskipTests -Dgpg.skip=true --file tcMenuGenerator/pom.xml + cd tcMenuGenerator/target + cp classes/img/tcMenuDesigner.ico . + jpackage -n tcMenuDesigner \ + -p jfx/deps \ + --input jfx/app \ + --icon ./classes/img/menu-icon.png \ + --verbose \ + --license-file ../../LICENSE \ + --linux-app-category Development \ + --linux-menu-group "Development;Utility;" \ + --java-options "-Dprism.lcdtext=false -Djava.library.path=$APPDIR/lin" \ + --app-version ${{ env.version }} \ + --add-modules "jdk.crypto.cryptoki" \ + -m com.thecoderscorner.tcmenu.menuEditorUI/com.thecoderscorner.menu.editorui.cli.TcMenuDesignerCmd + + - name: Upload DEB artifact + uses: actions/upload-artifact@v3 + with: + name: tcmenudesigner_${{ env.version }}_linux_deb-${{ github.sha }} + path: | + tcMenuGenerator/target/tcmenudesigner_${{ env.version }}_amd64.deb \ No newline at end of file diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml new file mode 100644 index 00000000..a868b16b --- /dev/null +++ b/.github/workflows/build_mac.yml @@ -0,0 +1,54 @@ +name: Build macOS Binary + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build-macos-binary: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 22 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'liberica' + cache: maven + + - name: Extract version from Maven cache + id: get-version + run: | + version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ + -Dexpression=project.version -q -DforceStdout --file tcMenuGenerator/pom.xml) + echo "version=$version" >> $GITHUB_ENV + + - name: Build tcMenuGenerator binary + run: | + mvn -B install -DskipTests -Dgpg.skip=true --file tcMenuJavaApi/pom.xml + mvn -B install -DskipTests -Dgpg.skip=true --file embedCONTROLCore/pom.xml + mvn -B install -DskipTests -Dgpg.skip=true --file tcMenuGenerator/pom.xml + cd tcMenuGenerator/target + jpackage -n tcMenuDesigner \ + -p jfx/deps \ + --input jfx/app \ + --icon ./classes/img/AppIcon.icns \ + --verbose \ + --license-file ../../LICENSE \ + --vendor TheCodersCorner \ + --app-version ${{ env.version }} \ + --add-modules "jdk.crypto.cryptoki" \ + --java-options "-Dprism.lcdtext=false -Djava.library.path=$APPDIR/mac" \ + -m com.thecoderscorner.tcmenu.menuEditorUI/com.thecoderscorner.menu.editorui.cli.TcMenuDesignerCmd + + - name: Upload macOS artifact + uses: actions/upload-artifact@v3 + with: + name: tcmenudesigner_${{ env.version }}_macos-${{ github.sha }} + path: | + tcMenuGenerator/target/tcMenuDesigner-${{ env.version }}.dmg \ No newline at end of file diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml new file mode 100644 index 00000000..21626a0d --- /dev/null +++ b/.github/workflows/build_windows.yml @@ -0,0 +1,68 @@ +name: Build Windows Binary + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build-windows-binary: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 22 + uses: actions/setup-java@v4 + with: + java-version: '22' + distribution: 'liberica' + cache: maven + + - name: Extract version from Maven cache + id: get-version + shell: bash + run: | + version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ + -Dexpression=project.version -q -DforceStdout --file tcMenuGenerator/pom.xml) + echo "version=$version" >> $GITHUB_ENV + + - name: Build tcMenuGenerator binaries + run: | + mvn -B install -DskipTests -Dgpg.skip=true --file tcMenuJavaApi/pom.xml + mvn -B install -DskipTests -Dgpg.skip=true --file embedCONTROLCore/pom.xml + mvn -B install -DskipTests -Dgpg.skip=true --file tcMenuGenerator/pom.xml + cd tcMenuGenerator/target + jpackage --type app-image -n tcmenu \ + -p jfx/deps \ + --input jfx/app \ + --win-console \ + --resource-dir .\classes\img\ \ + --icon tcMenuDesigner.ico \ + --app-version ${{ env.version }} \ + --verbose \ + --java-options "-Dprism.lcdtext=false -Djava.library.path=$APPDIR/win" \ + --add-modules "jdk.crypto.cryptoki" \ + -m com.thecoderscorner.tcmenu.menuEditorUI/com.thecoderscorner.menu.editorui.cli.TcMenuDesignerCmd + jpackage --type app-image -n tcMenuDesigner \ + -p jfx/deps \ + --input jfx/app \ + --resource-dir .\classes\img\ \ + --icon tcMenuDesigner.ico \ + --app-version ${{ env.version }} \ + --verbose \ + --java-options "-Dprism.lcdtext=false -Djava.library.path=$APPDIR/win" \ + --add-modules "jdk.crypto.cryptoki" \ + -m com.thecoderscorner.tcmenu.menuEditorUI/com.thecoderscorner.menu.editorui.cli.TcMenuDesignerCmd + + - name: Upload Windows artifacts + uses: actions/upload-artifact@v3 + with: + name: tcmenudesigner_${{ env.version }}_windows_exe-${{ github.sha }} + path: | + tcMenuGenerator/target/tcmenu + tcMenuGenerator/target/tcMenuDesigner + tcMenuGenerator/target/tcmenu/app/tcmenu.cfg + tcMenuGenerator/target/tcMenuDesigner/app/tcMenuDesigner.cfg \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 77% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index d2ebdb09..584a669d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Build +name: Test on: push: @@ -6,7 +6,7 @@ on: branches: [ "main" ] jobs: - build: + test: runs-on: ubuntu-latest @@ -19,11 +19,11 @@ jobs: distribution: 'liberica' cache: maven - - name: Build tcMenuJavaApi + - name: Build and test tcMenuJavaApi run: mvn -B install -Dgpg.skip=true --file tcMenuJavaApi/pom.xml - - name: Build embedCONTROLCore + - name: Build and test embedCONTROLCore run: mvn -B install -Dgpg.skip=true --file embedCONTROLCore/pom.xml - - name: Build tcMenuGenerator + - name: Build and test tcMenuGenerator run: mvn -B install -Dgpg.skip=true --file tcMenuGenerator/pom.xml diff --git a/README.md b/README.md index 4c41b1cd..16c6f4f7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ ## tcMenu - A menu library and designer for Arduino and mbed with IoT capabilities -[![Java Build](https://github.com/TcMenu/tcMenu/actions/workflows/build.yml/badge.svg)](https://github.com/TcMenu/tcMenu/actions/workflows/build.yml) +[![Java Test](https://github.com/TcMenu/tcMenu/actions/workflows/test.yml/badge.svg)](https://github.com/TcMenu/tcMenu/actions/workflows/test.yml) +[![Linux Nightly Build](https://github.com/TcMenu/tcMenu/actions/workflows/build_linux.yml/badge.svg)](https://github.com/TcMenu/tcMenu/actions/workflows/build_linux.yml) +[![macOS Nightly Build](https://github.com/TcMenu/tcMenu/actions/workflows/build_mac.yml/badge.svg)](https://github.com/TcMenu/tcMenu/actions/workflows/build_mac.yml) +[![Windows Nightly Build](https://github.com/TcMenu/tcMenu/actions/workflows/build_windows.yml/badge.svg)](https://github.com/TcMenu/tcMenu/actions/workflows/build_windows.yml) [![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-green.svg)](https://github.com/TcMenu/tcMenu/blob/main/LICENSE) [![GitHub release](https://img.shields.io/github/release/TcMenu/tcMenu.svg?maxAge=3600)](https://github.com/TcMenu/tcMenu/releases) [![davetcc](https://img.shields.io/badge/davetcc-dev-blue.svg)](https://github.com/davetcc)