1+ # ##################################################################################################
2+ # ## THIS IS A REUSABLE WORKFLOW TO BUILD THE SCALA LAUNCHERS ###
3+ # ## HOW TO USE: ###
4+ # ## - THSI WORKFLOW WILL PACKAGE THE ALL THE LAUNCHERS AND UPLOAD THEM TO GITHUB ARTIFACTS ###
5+ # ## ###
6+ # ## NOTE: ###
7+ # ## - SEE THE WORFLOW FOR THE NAMES OF THE ARTIFACTS ###
8+ # ##################################################################################################
9+
10+
11+ name : Build Scala Launchers
12+ run-name : Build Scala Launchers
13+
14+ on :
15+ workflow_call :
16+ inputs :
17+ java-version :
18+ type : string
19+ required : true
20+ outputs :
21+ universal-id :
22+ description : ID of the `universal` package from GitHub Artifacts (Authentication Required)
23+ value : ${{ jobs.build.outputs.universal-id }}
24+ linux-x86_64-id :
25+ description : ID of the `linux x86-64` package from GitHub Artifacts (Authentication Required)
26+ value : ${{ jobs.build.outputs.linux-x86_64-id }}
27+ linux-aarch64-id :
28+ description : ID of the `linux aarch64` package from GitHub Artifacts (Authentication Required)
29+ value : ${{ jobs.build.outputs.linux-aarch64-id }}
30+ mac-x86_64-id :
31+ description : ID of the `mac x86-64` package from GitHub Artifacts (Authentication Required)
32+ value : ${{ jobs.build.outputs.mac-x86_64-id }}
33+ mac-aarch64-id :
34+ description : ID of the `mac aarch64` package from GitHub Artifacts (Authentication Required)
35+ value : ${{ jobs.build.outputs.mac-aarch64-id }}
36+ win-x86_64-id :
37+ description : ID of the `win x86-64` package from GitHub Artifacts (Authentication Required)
38+ value : ${{ jobs.build.outputs.win-x86_64-id }}
39+ win-x86_64-digest :
40+ description : The SHA256 of the uploaded artifact (`win x86-64`)
41+ value : ${{ jobs.build.outputs.win-x86_64-digest }}
42+
43+
44+ jobs :
45+ build :
46+ runs-on : ubuntu-latest
47+ outputs :
48+ universal-id : ${{ steps.universal.outputs.artifact-id }}
49+ linux-x86_64-id : ${{ steps.linux-x86_64.outputs.artifact-id }}
50+ linux-aarch64-id : ${{ steps.linux-aarch64.outputs.artifact-id }}
51+ mac-x86_64-id : ${{ steps.mac-x86_64.outputs.artifact-id }}
52+ mac-aarch64-id : ${{ steps.mac-aarch64.outputs.artifact-id }}
53+ win-x86_64-id : ${{ steps.win-x86_64.outputs.artifact-id }}
54+ win-x86_64-digest : ${{ steps.win-x86_64-digest.outputs.digest }}
55+ steps :
56+ - uses : actions/checkout@v4
57+ - uses : actions/setup-java@v4
58+ with :
59+ distribution : temurin
60+ java-version : ${{ inputs.java-version }}
61+ cache : sbt
62+ - name : Build and pack the SDK (universal)
63+ run : ./project/scripts/sbt dist/Universal/stage
64+ - name : Build and pack the SDK (linux x86-64)
65+ run : ./project/scripts/sbt dist-linux-x86_64/Universal/stage
66+ - name : Build and pack the SDK (linux aarch64)
67+ run : ./project/scripts/sbt dist-linux-aarch64/Universal/stage
68+ - name : Build and pack the SDK (mac x86-64)
69+ run : ./project/scripts/sbt dist-mac-x86_64/Universal/stage
70+ - name : Build and pack the SDK (mac aarch64)
71+ run : ./project/scripts/sbt dist-mac-aarch64/Universal/stage
72+ - name : Build and pack the SDK (win x86-64)
73+ run : ./project/scripts/sbt dist-win-x86_64/Universal/stage
74+ - name : Upload zip archive to GitHub Artifact (universal)
75+ uses : actions/upload-artifact@v4
76+ id : universal
77+ with :
78+ path : ./dist/target/universal/stage
79+ name : scala3-universal
80+ - name : Upload zip archive to GitHub Artifact (linux x86-64)
81+ uses : actions/upload-artifact@v4
82+ id : linux-x86_64
83+ with :
84+ path : ./dist/linux-x86_64/target/universal/stage
85+ name : scala3-x86_64-pc-linux
86+ - name : Upload zip archive to GitHub Artifact (linux aarch64)
87+ uses : actions/upload-artifact@v4
88+ id : linux-aarch64
89+ with :
90+ path : ./dist/linux-aarch64/target/universal/stage
91+ name : scala3-aarch64-pc-linux
92+ - name : Upload zip archive to GitHub Artifact (mac x86-64)
93+ uses : actions/upload-artifact@v4
94+ id : mac-x86_64
95+ with :
96+ path : ./dist/mac-x86_64/target/universal/stage
97+ name : scala3-x86_64-apple-darwin
98+ - name : Upload zip archive to GitHub Artifact (mac aarch64)
99+ uses : actions/upload-artifact@v4
100+ id : mac-aarch64
101+ with :
102+ path : ./dist/mac-aarch64/target/universal/stage
103+ name : scala3-aarch64-apple-darwin
104+ - name : Upload zip archive to GitHub Artifact (win x86-64)
105+ uses : actions/upload-artifact@v4
106+ id : win-x86_64
107+ with :
108+ path : ./dist/win-x86_64/target/universal/stage
109+ name : scala3-x86_64-pc-win32
110+ - name : Compute SHA256 of the uploaded artifact (win x86-64)
111+ id : win-x86_64-digest
112+ run : |
113+ curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o artifact.zip -L https://api.github.com/repos/scala/scala3/actions/artifacts/${{ steps.win-x86_64.outputs.artifact-id }}/zip
114+ echo "digest=$(sha256sum artifact.zip | cut -d " " -f 1)" >> "$GITHUB_OUTPUT"
115+
116+
0 commit comments