Skip to content

Commit

Permalink
Merge pull request MegaMek#5658 from rjhancock/windows-ci-fix
Browse files Browse the repository at this point in the history
Fix for Windows Build
  • Loading branch information
HammerGS authored Jul 1, 2024
2 parents c2c63b1 + 7efe8b5 commit 7feed78
Show file tree
Hide file tree
Showing 8 changed files with 435 additions and 226 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# Run this job once for each combination in the matrix below.
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
java-distribution: [temurin]
java-version: [17]
fail-fast: false
Expand Down Expand Up @@ -61,17 +61,15 @@ jobs:
# NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere.
- name: Upload Nix/Mac Releases
uses: actions/upload-artifact@v4
if: always() && matrix.os == 'ubuntu-latest'
with:
name: mm-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: megamek/megamek/build/distributions/*.tar.gz
path: megamek/megamek/build/distributions/megamek-0*.tar.gz

# Put the Windows Release in an artifact
#
# NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere.
- name: Upload Windows Release
uses: actions/upload-artifact@v4
if: always() && matrix.os == 'windows-latest'
with:
name: mm-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: megamek/megamek/build/distributions/megamek-windows-*.zip
2 changes: 1 addition & 1 deletion .github/workflows/validate-namechanges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Build with Gradle
working-directory: megamek
run: ./gradlew jar
run: ./gradlew build

- name: Validate Name Changes
working-directory: megamek
Expand Down
14 changes: 11 additions & 3 deletions megamek/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ task stageFiles {
task createStartScripts (type: CreateStartScripts) {
description = 'Create shell script for generic distribution.'
applicationName = 'mm'
mainClass = project.mainClassName
mainClass = application.mainClass
outputDir = startScripts.outputDir
classpath = jar.outputs.files + files(project.sourceSets.main.runtimeClasspath.files)
.filter { it.name.endsWith(".jar") }
Expand Down Expand Up @@ -242,18 +242,26 @@ distributions {

createExe {
description = 'Create Windows executable that wraps MM jar'
mainClassName = project.mainClassName
mainClassName = application.mainClass
outfile = 'MegaMek.exe'
def iniFile = 'MegaMek.l4j.ini'
icon = "${projectDir}/data/images/misc/megamek.ico"
jarTask = project.tasks.jar
downloadUrl = 'https://adoptium.net/temurin/releases/?os=windows&arch=x64'
downloadUrl = 'https://github.com/MegaMek/megamek/wiki/Updating-to-Adoptium'
supportUrl = 'https://megamek.org'
copyright = '2024 MegaMek Development Team'
companyName = "MegaMek Development Team"
outputs.file "${buildDir}/launch4j/${outfile}"
outputs.file "${buildDir}/launch4j/${iniFile}"
jvmOptions = project.ext.mmJvmOptions
jreMinVersion = '17'
messagesJreNotFoundError = 'Go here for instructions on installing the correct version of Java: https://github.com/MegaMek/megamek/wiki/Updating-to-Adoptium'
doLast {
new File("${buildDir}/launch4j/${iniFile}").text = """# Launch4j runtime config
# you can add arguments here that will be processed by the JVM at runtime
${project.ext.mmJvmOptions.join('\n')}
"""
}
}

windowsDistZip {
Expand Down
Loading

0 comments on commit 7feed78

Please sign in to comment.