Skip to content

Commit

Permalink
ci: build MSI (#784)
Browse files Browse the repository at this point in the history
* ci: build MSI

* fix: remove auto-build of JAR when packaging MSI

* Improve error message

* fix: correctly set CI MSI dependency

* fix: set up JDK for MSI action

* fix: add version number to the MSI filename

* fix: use wildcard for MSI upload
  • Loading branch information
lupino3 committed Sep 21, 2023
1 parent 9281ed7 commit d7da13a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,35 @@ jobs:
name: JAR
path: ./build/libs/edumips64-${{ steps.read_version.outputs.version }}.jar

build-msi:
name: Build Windows MSI
runs-on: windows-latest
needs: build-desktop
steps:
- uses: actions/checkout@v2
- name: Install Wix
uses: actions/checkout@v2
with:
repository: fbarresi/wix
path: wix
- name: Download JAR
uses: actions/download-artifact@v2.1.1
with:
name: JAR
path: build/libs
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'microsoft'
- name: Build MSI
run: ./gradlew MSI
- name: Upload MSI
uses: actions/upload-artifact@v3.1.2
with:
name: MSI
path: EduMIPS64-*.msi

build-web:
name: Build web application
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ tasks.create<Exec>("msi"){
group = "Distribution"
description = "Creates an installable MSI file"
workingDir = File("${projectDir}")
dependsOn("jar")

doFirst{
var os = System.getProperty("os.name") as String;
Expand All @@ -260,6 +259,9 @@ tasks.create<Exec>("msi"){
if (majorVersion < 14) {
throw GradleException("JDK 14+ is required to create the MSI package.")
}
if (!File("build/libs/edumips64-${version}.jar").exists()) {
throw GradleException("Could not find build/libs/edumips64-${version}.jar. Please execute ./gradlew jar before trying to build the MSI.")
}

if (System.getenv("WIX") == null){
throw GradleException("Wix is required to create the MSI package.")
Expand Down

0 comments on commit d7da13a

Please sign in to comment.