Skip to content

Commit

Permalink
Build artifacts after push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
vzahradnik committed Jan 3, 2025
1 parent 84a403b commit 3d34449
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 6 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -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
54 changes: 54 additions & 0 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
@@ -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
71 changes: 71 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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
shell: bash
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 --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
cp classes/img/tcMenuDesigner.ico .
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
10 changes: 5 additions & 5 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build
name: Test

on:
push:
pull_request:
branches: [ "main" ]

jobs:
build:
test:

runs-on: ubuntu-latest

Expand All @@ -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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 3d34449

Please sign in to comment.