Skip to content

Commit a142481

Browse files
authored
Composite actions and a new native matrix build
1 parent bafa841 commit a142481

12 files changed

Lines changed: 380 additions & 141 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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: Set up JDK 21 # NBPackage requires JDK
19+
uses: actions/setup-java@v5
20+
with:
21+
java-version: '21'
22+
distribution: 'temurin'
23+
24+
- name: Download bundle
25+
uses: actions/download-artifact@v8
26+
with:
27+
name: bundle
28+
path: dist
29+
30+
- name: Download NBPackage
31+
uses: actions/download-artifact@v8
32+
with:
33+
name: nbpackage
34+
path: installers/nbpackage
35+
36+
- name: Download JDKs
37+
run: bash download-jdks.sh ${{ inputs.os }} ${{ inputs.arch }}
38+
working-directory: installers
39+
shell: bash
40+
41+
- name: Grant execute permission for NBPackage
42+
if: runner.os == 'Linux' || runner.os == 'macOS'
43+
run: chmod +x installers/nbpackage/bin/nbpackage
44+
shell: bash
45+
46+
- name: Build installers
47+
run: bash build-installers.sh ${{ inputs.tag }} ${{ inputs.os }} ${{ inputs.arch }}
48+
working-directory: installers
49+
shell: bash
50+
51+
- name: Upload installers
52+
uses: actions/upload-artifact@v7
53+
with:
54+
name: installers-${{ inputs.os }}-${{ inputs.arch }}
55+
path: |
56+
dist/installers/*.deb
57+
dist/installers/*.exe
58+
dist/installers/*.pkg
59+
compression-level: 0
60+
if-no-files-found: error
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: "If specified, creates a ZIP distributable bundle"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v5
19+
with:
20+
java-version: '21'
21+
distribution: 'temurin'
22+
23+
- name: Validate the Gradle wrapper
24+
uses: gradle/actions/wrapper-validation@v6
25+
26+
- name: Grant execute permission for gradle
27+
run: chmod +x gradlew
28+
shell: bash
29+
30+
- name: Build the SDK (with tag)
31+
if: inputs.tag != ''
32+
run: ./gradlew buildSdk -Ptag_name=${{ inputs.tag }}
33+
shell: bash
34+
35+
- name: Build the SDK
36+
if: inputs.tag == ''
37+
run: ./gradlew buildSdk
38+
shell: bash
39+
40+
- name: Override Harness (custom icon)
41+
if: inputs.createBundle == 'true'
42+
run: ./gradlew overrideHarness -Ptag_name=${{ github.ref_name }}
43+
shell: bash
44+
45+
- name: Build distributable ZIP
46+
if: inputs.createBundle == 'true'
47+
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-zip unset-spec-version
48+
shell: bash
49+
50+
- name: Upload distributable ZIP bundle
51+
if: inputs.createBundle == 'true'
52+
uses: actions/upload-artifact@v7
53+
with:
54+
name: bundle
55+
path: dist/jmonkeyplatform.zip
56+
compression-level: 0
57+
if-no-files-found: error
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "NBM deployment"
2+
description: "Deploys NBM packages"
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+
shell: bash
24+
25+
- name: Overwrite the target file
26+
run: rm -rf nightly/target && echo 'echo "sdk_sha=${{ github.sha }}" >> $GITHUB_ENV' > nightly/target
27+
shell: bash
28+
29+
- name: Trigger nightly builds
30+
working-directory: nightly
31+
run: git add target && git commit -m "Trigger a fresh nightly build for https://github.com/jMonkeyEngine/sdk/commit/${{ github.sha }}" && git push
32+
shell: bash
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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
11+
12+
- name: Upload NBPackage
13+
uses: actions/upload-artifact@v7
14+
with:
15+
name: nbpackage
16+
path: installers/nbpackage/
17+
compression-level: 9
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Publish Release"
2+
description: "Create GitHub release from artifacts"
3+
4+
inputs:
5+
tag:
6+
required: true
7+
description: "Tag should be used for releases"
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Download installers
13+
uses: actions/download-artifact@v8
14+
with:
15+
pattern: installers-*
16+
path: release-assets
17+
merge-multiple: true
18+
19+
- name: Download ZIP bundle
20+
uses: actions/download-artifact@v8
21+
with:
22+
name: bundle
23+
path: release-assets
24+
25+
- name: Create Release
26+
uses: softprops/action-gh-release@v3
27+
with:
28+
files: release-assets/*
29+
tag_name: ${{ github.ref }}
30+
name: Release ${{ github.ref }}
31+
env:
32+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/gradle.yml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,29 @@
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
14-
1514
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'
15+
- uses: actions/checkout@v6
2216

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-
2917
- name: Build the SDK
30-
run: ./gradlew buildSdk
18+
uses: ./.github/actions/build-sdk
3119

3220
NBMDeployment:
3321
needs: [BuildSDK]
3422
runs-on: ubuntu-latest
3523
if: github.event_name == 'push'
36-
24+
3725
steps:
38-
- name: Checkout the nightly-trigger repository
39-
uses: actions/checkout@v3
26+
- name: Deploy NBMs
27+
uses: ./.github/actions/nbm-deployment
4028
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
29+
token: ${{ secrets. UPDATE_CENTER_PAT }}

.github/workflows/release.yml

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,61 @@
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
21-
- 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
15+
- uses: actions/checkout@v6
3516

17+
- name: Build the SDK
18+
uses: ./.github/actions/build-sdk
3619
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 }}
20+
tag: ${{ github.ref_name }}
21+
createBundle: true
22+
23+
- name: Prepare installers
24+
uses: ./.github/actions/prepare-installers
25+
26+
# -------------------------------
27+
# 2. Native installer packaging (matrix)
28+
# -------------------------------
29+
package:
30+
needs: build
31+
32+
strategy:
33+
matrix:
34+
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-26-intel ]
35+
36+
runs-on: ${{ matrix.os }}
37+
38+
steps:
39+
- uses: actions/checkout@v6
40+
41+
- name: Build installers
42+
uses: ./.github/actions/build-installers
43+
with:
44+
tag: ${{ github.ref_name }}
45+
os: ${{ runner.os }}
46+
arch: ${{ runner.arch }}
47+
48+
# -------------------------------
49+
# 3. Release
50+
# -------------------------------
51+
release:
52+
needs: package
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- uses: actions/checkout@v6
57+
58+
- name: Publish release
59+
uses: ./.github/actions/publish-release
60+
with:
61+
tag: ${{ github.ref }}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
55
import java.util.zip.ZipFile
66

77
plugins {
8-
id "de.undercouch.download" version "5.1.0"
8+
id "de.undercouch.download" version "5.7.0"
99
}
1010

1111
apply from: 'gradle/libs/digest.gradle'

0 commit comments

Comments
 (0)