Skip to content

Commit

Permalink
first trial to build the msi
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Jun 13, 2024
1 parent ae7a49c commit 283a779
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-msi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

name: Build the MSI Package

on:
push:

jobs:
build:
runs-on: windows-latest
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/
1 change: 1 addition & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2181,6 +2181,7 @@ object Build {
Universal / mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
)
.settings(
Windows / name := "scala",
Windows / mappings := (Universal / mappings).value,
maintainer := "Josh Suereth <[email protected]>",
packageSummary := "test-windows",
Expand Down
50 changes: 50 additions & 0 deletions project/DistributionPlugin.scala
Original file line number Diff line number Diff line change
@@ -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` := ???
)

}

0 comments on commit 283a779

Please sign in to comment.