Skip to content

Commit 88a77b7

Browse files
committed
first trial to build the msi
1 parent ae7a49c commit 88a77b7

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

.github/workflows/build-msi.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
name: Build the MSI Package
3+
4+
on:
5+
push:
6+
7+
jobs:
8+
build:
9+
runs-on: windows-latest
10+
env:
11+
RELEASEBUILD: yes
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- uses: actions/setup-java@v3
17+
with:
18+
distribution: 'adopt'
19+
java-version: '11'
20+
cache: 'sbt'
21+
- name: Build MSI package
22+
run: |
23+
sbt 'dist-win-x86_64/Windows/packageBin'
24+
- name: Upload MSI Artifact
25+
uses: actions/upload-artifact@v3
26+
with:
27+
name: scala.msi
28+
path: ./dist/win-x86_64/target/windows/

project/Build.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ object Build {
9292

9393
val referenceVersion = "3.4.2-RC1"
9494

95-
val baseVersion = "3.5.1-RC1"
95+
val baseVersion = "3.5.1"
9696

9797
// LTS or Next
9898
val versionLine = "Next"
@@ -2181,7 +2181,9 @@ object Build {
21812181
Universal / mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
21822182
)
21832183
.settings(
2184+
Windows / name := "scala",
21842185
Windows / mappings := (Universal / mappings).value,
2186+
Windows / packageBin := (Windows / packageBin).dependsOn(republish).value,
21852187
maintainer := "Josh Suereth <[email protected]>",
21862188
packageSummary := "test-windows",
21872189
packageDescription := """Test Windows MSI.""",

project/DistributionPlugin.scala

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import com.typesafe.sbt.packager.Keys.stage
2+
import com.typesafe.sbt.packager.universal.UniversalPlugin
3+
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.Universal
4+
import sbt.*
5+
6+
/**
7+
* @author Hamza REMMAL (https://github.com/hamzaremmal/)
8+
*/
9+
object DistributionPlugin extends AutoPlugin {
10+
11+
override def trigger = allRequirements
12+
13+
override def requires =
14+
super.requires && UniversalPlugin // Require the Universal Plugin to
15+
16+
object autoImport {
17+
val `universal_project` = settingKey[Project]("???")
18+
val `linux-aarch64_project` = settingKey[Project]("???")
19+
val `linux-x86_64_project` = settingKey[Project]("???")
20+
val `mac-aarch64_project` = settingKey[Project]("???")
21+
val `win-x86_64_project` = settingKey[Project]("???")
22+
23+
24+
// ========================== TASKS TO GENERATE THE FOLDER PACKAGE ============================
25+
val `pack-universal` =
26+
taskKey[File]("Generate the package with the universal binaries (folder)")
27+
val `pack_linux-aarch64` =
28+
taskKey[File]("Generate the package with the linux-aarch64 binaries (folder)")
29+
val `pack_linux-x86_64` =
30+
taskKey[File]("Generate the package with the linux-x86_64 binaries (folder)")
31+
val `pack_mac-aarch64` =
32+
taskKey[File]("Generate the package with the mac-aarch64 binaries (folder)")
33+
val `pack_mac-x86_64` =
34+
taskKey[File]("Generate the package with the mac-x86_64 binaries (folder)")
35+
val `pack_win-x86_64` =
36+
taskKey[File]("Generate the package with the linux-x86_64 binaries (folder)")
37+
}
38+
39+
import autoImport.*
40+
41+
override def projectSettings = Def.settings(
42+
`pack-universal` := (`universal_project` / Universal./(stage)).value ,
43+
`pack_linux-aarch64` := ???,
44+
`pack_linux-x86_64` := ???,
45+
`pack_mac-aarch64` := ???,
46+
`pack_mac-x86_64` := ???,
47+
`pack_win-x86_64` := ???
48+
)
49+
50+
}

0 commit comments

Comments
 (0)