Skip to content

Commit c26ef4d

Browse files
committed
Composite actions and a new native matrix build
1 parent 4f68914 commit c26ef4d

9 files changed

Lines changed: 254 additions & 112 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Build installers"
2+
description: "Builds installers for the given target environment"
3+
4+
inputs:
5+
tag:
6+
required: true
7+
description: "Tag should be used for releases"
8+
os:
9+
required: true
10+
description: "Operating system string"
11+
arch:
12+
required: true
13+
description: "System architecture string"
14+
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Download JDKs
19+
run: bash download-jdks.sh ${{ inputs.os }} ${{ inputs.arch }}
20+
shell: bash
21+
22+
- name: Build installers
23+
run: bash build-installers.sh ${{ inputs.tag }} ${{ inputs.os }} ${{ inputs.arch }}
24+
shell: bash
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Build SDK"
2+
description: "Setups and builds the SDK (Linux)"
3+
4+
inputs:
5+
tag:
6+
required: false
7+
description: "Tag should be used for releases"
8+
createBundle:
9+
required: false
10+
default: false
11+
type: boolean
12+
description: "Tag should be used for releases"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- uses: actions/checkout@v6
18+
- name: Set up JDK 21
19+
uses: actions/setup-java@v5
20+
with:
21+
java-version: '21'
22+
distribution: 'temurin'
23+
24+
- name: Validate the Gradle wrapper
25+
uses: gradle/actions/wrapper-validation@v3
26+
27+
- name: Grant execute permission for gradle
28+
run: chmod +x gradlew
29+
shell: bash
30+
31+
- name: Build the SDK (with tag)
32+
if: ${{ inputs.tag }} != null
33+
run: ./gradlew buildSdk -Ptag_name=${{ inputs.tag }}
34+
shell: bash
35+
36+
- name: Build the SDK
37+
if: ${{ inputs.tag }} == null
38+
run: ./gradlew buildSdk
39+
shell: bash
40+
41+
- name: Override Harness (custom icon)
42+
if: ${{ inputs.createBundle }}
43+
run: ./gradlew overrideHarness -Ptag_name=${{ github.ref_name }}
44+
shell: bash
45+
46+
- name: Build distributable ZIP
47+
if: ${{ inputs.createBundle }}
48+
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-zip unset-spec-version
49+
shell: bash
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Build SDK"
2+
description: "Setups and builds the SDK (Linux)"
3+
4+
inputs:
5+
token:
6+
required: true
7+
description: "SDK Update Center token"
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Checkout the nightly-trigger repository
13+
uses: actions/checkout@v6
14+
with:
15+
repository: 'jMonkeyEngine/sdk-update-center'
16+
ref: nightly
17+
path: nightly
18+
token: ${{ inputs.token }}
19+
20+
- name: Setup Git for the commit
21+
run: git config user.email MeFisto94@users.noreply.github.com && git config user.name MeFisto94
22+
working-directory: nightly
23+
24+
- name: Overwrite the target file
25+
run: rm -rf nightly/target && echo 'echo "sdk_sha=${{ github.sha }}" >> $GITHUB_ENV' > nightly/target
26+
27+
- name: Trigger nightly builds
28+
working-directory: nightly
29+
run: git add target && git commit -m "Trigger a fresh nightly build for https://github.com/jMonkeyEngine/sdk/commit/${{ github.sha }}" && git push
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Prepare installers"
2+
description: "Setups the NBPackage needed to build the installers"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Prepare NBPackage
8+
run: bash prepare-installers.sh
9+
working-directory: installers
10+
shell: bash

.github/workflows/gradle.yml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,28 @@
11
# This Action will build the SDK and if this succeeds, trigger a build on the
2-
# jMonkeyEngine/sdk-update-center repository, so that nbms get built and
2+
# jMonkeyEngine/sdk-update-center repository, so that NBMs get built and
33
# deployed
44
name: Nightly NBM Deployment
55

66
on:
77
push:
88
branches: [ master ]
99
pull_request:
10-
10+
1111
jobs:
1212
BuildSDK:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up JDK 21
18-
uses: actions/setup-java@v3
19-
with:
20-
java-version: 21
21-
distribution: 'temurin'
22-
23-
- name: Validate the Gradle wrapper
24-
uses: gradle/wrapper-validation-action@v2
25-
26-
- name: Grant execute permission for gradle
27-
run: chmod +x gradlew
28-
2916
- name: Build the SDK
30-
run: ./gradlew buildSdk
17+
uses: ./.github/actions/build-sdk
3118

3219
NBMDeployment:
3320
needs: [BuildSDK]
3421
runs-on: ubuntu-latest
3522
if: github.event_name == 'push'
36-
23+
3724
steps:
38-
- name: Checkout the nightly-trigger repository
39-
uses: actions/checkout@v3
25+
- name: Deploy NBMs
26+
uses: ./.github/actions/nbm-deployment
4027
with:
41-
repository: 'jMonkeyEngine/sdk-update-center'
42-
ref: nightly
43-
path: nightly
44-
token: ${{ secrets. UPDATE_CENTER_PAT }}
45-
46-
- name: Setup Git for the commit
47-
run: git config user.email MeFisto94@users.noreply.github.com && git config user.name MeFisto94
48-
working-directory: nightly
49-
50-
- name: Overwrite the target file
51-
run: rm -rf nightly/target && echo 'echo "sdk_sha=${{ github.sha }}" >> $GITHUB_ENV' > nightly/target
52-
53-
- name: Trigger nightly builds
54-
working-directory: nightly
55-
run: git add target && git commit -m "Trigger a fresh nightly build for https://github.com/jMonkeyEngine/sdk/commit/${{ github.sha }}" && git push
28+
token: ${{ secrets. UPDATE_CENTER_PAT }}

.github/workflows/release.yml

Lines changed: 87 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,99 @@
1-
# This Action will build the SDK and if this succeeds, create a github release
1+
# This Action will build the SDK and if this succeeds, create a GitHub release
22
name: Release Builds
33
on:
44
push:
55
tags:
66
- "*"
77
jobs:
8+
9+
# -------------------------------
10+
# 1. Build + bundle (Linux only)
11+
# -------------------------------
812
build:
913
runs-on: ubuntu-latest
1014
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up JDK 21
13-
uses: actions/setup-java@v3
14-
with:
15-
distribution: temurin
16-
java-version: 21
17-
- name: Install wine
18-
run: sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt install -y xorg xvfb xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic wine32:i386 wine makepkg
19-
- name: Grant execute permission for gradle
20-
run: chmod +x gradlew
2115
- name: Build the SDK
22-
run: ./gradlew buildSdk -Ptag_name=${{ github.ref_name }}
23-
- name: Override Harness (custom icon)
24-
run: ./gradlew overrideHarness -Ptag_name=${{ github.ref_name }}
25-
- name: Build Installers
26-
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-zip unset-spec-version
27-
- name: Download JDKs for the installers
28-
run: bash download-jdks.sh
29-
working-directory: installers
30-
- name: Build the installers
31-
run: bash build-installers.sh ${{ github.ref_name }} headless
32-
working-directory: installers
33-
- name: Create Release
34-
uses: softprops/action-gh-release@v1
16+
uses: ./.github/actions/build-sdk
17+
with:
18+
tag: ${{ github.ref_name }}
19+
createBundle: true
3520

21+
- name: Prepare installers
22+
uses: ./.github/actions/prepare-installers
23+
24+
- name: Upload bundle
25+
uses: actions/upload-artifact@v7
3626
with:
37-
files: |
38-
dist/jmonkeyplatform*.*
39-
dist/jmonkeyengine-sdk*.*
40-
dist/jMonkeyEngine-SDK*.*
41-
tag_name: ${{ github.ref }}
42-
name: Release ${{ github.ref }}
43-
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
name: bundle
28+
path: dist/jmonkeyplatform.zip
29+
compression-level: 0
30+
if-no-files-found: error
31+
32+
- name: Upload installers
33+
uses: actions/upload-artifact@v7
34+
with:
35+
name: installer-input
36+
path: |
37+
installers/
38+
nbpackage/
39+
compression-level: 9
40+
41+
# -------------------------------
42+
# 2. Native installer packaging (matrix)
43+
# -------------------------------
44+
package:
45+
needs: build
46+
47+
strategy:
48+
matrix:
49+
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-26-intel ]
50+
51+
runs-on: ${{ matrix.os }}
52+
53+
steps:
54+
- name: Download bundle
55+
uses: actions/download-artifact@v8
56+
57+
- name: Build installers
58+
uses: ./.github/actions/build-installers
59+
with:
60+
tag: ${{ github.ref_name }}
61+
os: ${{ runner.os }}
62+
arch: ${{ runner.arch }}
63+
64+
- name: Upload installers
65+
uses: actions/upload-artifact@v7
66+
with:
67+
name: installers-${{ matrix.os }}
68+
path: dist/installers/**
69+
70+
# -------------------------------
71+
# 3. Release
72+
# -------------------------------
73+
release:
74+
needs: package
75+
runs-on: ubuntu-latest
76+
77+
steps:
78+
- name: Publish release
79+
uses: ./.github/actions/publish-release
80+
with:
81+
tag: ${{ github.ref }}
82+
# - name: Download JDKs for the installers
83+
# run: bash download-jdks.sh
84+
# working-directory: installers
85+
# - name: Build the installers
86+
# run: bash build-installers.sh ${{ github.ref_name }} headless
87+
# working-directory: installers
88+
# - name: Create Release
89+
# uses: softprops/action-gh-release@v1
90+
#
91+
# with:
92+
# files: |
93+
# dist/jmonkeyplatform*.*
94+
# dist/jmonkeyengine-sdk*.*
95+
# dist/jMonkeyEngine-SDK*.*
96+
# tag_name: ${{ github.ref }}
97+
# name: Release ${{ github.ref }}
98+
# env:
99+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

installers/build-installers.sh

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,15 @@
22
#(c) jmonkeyengine.org
33

44
# Uses NBPackage to create installers for different platforms.
5-
# Prequisites for running this script:
5+
# Prerequisites for running this script:
66
# - The SDK ZIP build must already exist
77
# - JDKs must already been downloaded
8-
# Some quirks exist with the different platform installers:
9-
# - Linux DEPs are only created with current architecture
10-
# - Windows installer requires Inno Setup, this seems like an easy thing to break in this chain
8+
# - NBPackage must exist
119

1210
set -e # Quit on Error
1311

14-
nbpackage_version="1.0-beta6"
15-
nbpackage_url="https://archive.apache.org/dist/netbeans/netbeans-nbpackage/$nbpackage_version/nbpackage-$nbpackage_version-bin.zip"
1612
inno_setup_url="https://files.jrsoftware.org/is/6/innosetup-6.5.1.exe"
1713

18-
function download_nbpackage {
19-
echo "> Downloading the nbpackage"
20-
21-
22-
if [ -f "downloads/nbpackage.zip" ];
23-
then
24-
echo "< Already existing, SKIPPING."
25-
else
26-
mkdir -p downloads
27-
28-
curl -# -o downloads/nbpackage.zip -L $nbpackage_url
29-
echo "< OK!"
30-
fi
31-
}
32-
33-
function prepare_nbpackage {
34-
echo "> Extracting the nbpackage"
35-
36-
37-
if [ -d "nbpackage" ];
38-
then
39-
echo "< Already existing, SKIPPING."
40-
else
41-
unzip -qq downloads/nbpackage.zip -d nbpackage
42-
echo "< OK!"
43-
fi
44-
}
45-
4614
function build_nbpackage {
4715
echo ">> Building the nbpackage installer for $1-$2"
4816

@@ -112,7 +80,7 @@ function build_macos_pgk {
11280
echo "< OK!"
11381
}
11482

115-
echo "Building installers with version tag $1"
83+
echo "Building installers with version tag $1 on $2 arch $3"
11684

11785
versionString=$1
11886
if [[ $versionString != [[:digit:]]* ]];
@@ -121,9 +89,5 @@ then
12189
echo "Stripped version tag to $versionString"
12290
fi
12391

124-
download_nbpackage
125-
prepare_nbpackage
126-
build_linux_deb "$versionString"
127-
build_windows_installer "$versionString" "$2"
128-
# MACOS needs signed packages etc. So disabled
129-
#build_macos_pgk "$versionString"
92+
#build_linux_deb "$versionString"
93+
#build_windows_installer "$versionString" "$2"

installers/download-jdks.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,5 @@ function get_jdk {
6666
echo "< OK!"
6767
}
6868

69-
get_jdk linux x64
70-
get_jdk linux aarch64
71-
get_jdk windows x64
72-
#get_jdk macos x64
73-
#get_jdk macos aarch64
69+
echo "Building JDK with on $1 arch $2"
70+
get_jdk $1 $2

0 commit comments

Comments
 (0)