From 88a77b7cdf5d1c94a1d4ab904a525b830ce613ab Mon Sep 17 00:00:00 2001 From: Hamza REMMAL Date: Tue, 11 Jun 2024 15:58:00 +0100 Subject: [PATCH] first trial to build the msi --- .github/workflows/build-msi.yml | 28 ++++++++++++++++++ project/Build.scala | 4 ++- project/DistributionPlugin.scala | 50 ++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-msi.yml create mode 100644 project/DistributionPlugin.scala diff --git a/.github/workflows/build-msi.yml b/.github/workflows/build-msi.yml new file mode 100644 index 000000000000..145f58a8a868 --- /dev/null +++ b/.github/workflows/build-msi.yml @@ -0,0 +1,28 @@ + +name: Build the MSI Package + +on: + push: + +jobs: + build: + runs-on: windows-latest + env: + RELEASEBUILD: yes + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' + cache: 'sbt' + - name: Build MSI package + run: | + sbt 'dist-win-x86_64/Windows/packageBin' + - name: Upload MSI Artifact + uses: actions/upload-artifact@v3 + with: + name: scala.msi + path: ./dist/win-x86_64/target/windows/ diff --git a/project/Build.scala b/project/Build.scala index fc16f5ba8a43..f8f544ad3c9c 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -92,7 +92,7 @@ object Build { val referenceVersion = "3.4.2-RC1" - val baseVersion = "3.5.1-RC1" + val baseVersion = "3.5.1" // LTS or Next val versionLine = "Next" @@ -2181,7 +2181,9 @@ object Build { Universal / mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"), ) .settings( + Windows / name := "scala", Windows / mappings := (Universal / mappings).value, + Windows / packageBin := (Windows / packageBin).dependsOn(republish).value, maintainer := "Josh Suereth ", packageSummary := "test-windows", packageDescription := """Test Windows MSI.""", diff --git a/project/DistributionPlugin.scala b/project/DistributionPlugin.scala new file mode 100644 index 000000000000..473ecd8378af --- /dev/null +++ b/project/DistributionPlugin.scala @@ -0,0 +1,50 @@ +import com.typesafe.sbt.packager.Keys.stage +import com.typesafe.sbt.packager.universal.UniversalPlugin +import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.Universal +import sbt.* + +/** + * @author Hamza REMMAL (https://github.com/hamzaremmal/) + */ +object DistributionPlugin extends AutoPlugin { + + override def trigger = allRequirements + + override def requires = + super.requires && UniversalPlugin // Require the Universal Plugin to + + object autoImport { + val `universal_project` = settingKey[Project]("???") + val `linux-aarch64_project` = settingKey[Project]("???") + val `linux-x86_64_project` = settingKey[Project]("???") + val `mac-aarch64_project` = settingKey[Project]("???") + val `win-x86_64_project` = settingKey[Project]("???") + + + // ========================== TASKS TO GENERATE THE FOLDER PACKAGE ============================ + val `pack-universal` = + taskKey[File]("Generate the package with the universal binaries (folder)") + val `pack_linux-aarch64` = + taskKey[File]("Generate the package with the linux-aarch64 binaries (folder)") + val `pack_linux-x86_64` = + taskKey[File]("Generate the package with the linux-x86_64 binaries (folder)") + val `pack_mac-aarch64` = + taskKey[File]("Generate the package with the mac-aarch64 binaries (folder)") + val `pack_mac-x86_64` = + taskKey[File]("Generate the package with the mac-x86_64 binaries (folder)") + val `pack_win-x86_64` = + taskKey[File]("Generate the package with the linux-x86_64 binaries (folder)") + } + + import autoImport.* + + override def projectSettings = Def.settings( + `pack-universal` := (`universal_project` / Universal./(stage)).value , + `pack_linux-aarch64` := ???, + `pack_linux-x86_64` := ???, + `pack_mac-aarch64` := ???, + `pack_mac-x86_64` := ???, + `pack_win-x86_64` := ??? + ) + +}