Skip to content

Commit 4a1b744

Browse files
authored
Merge pull request #236 from armanbilge/feature/native
Cross-build for Native
2 parents 7588d4d + 98cfed5 commit 4a1b744

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
os: [ubuntu-latest]
3131
scala: [3.1.3, 2.12.16, 2.13.8]
3232
java: [temurin@8]
33-
project: [rootJS, rootJVM]
33+
project: [rootJS, rootJVM, rootNative]
3434
runs-on: ${{ matrix.os }}
3535
steps:
3636
- name: Checkout current branch (full)
@@ -77,6 +77,10 @@ jobs:
7777
if: matrix.project == 'rootJS'
7878
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult
7979

80+
- name: nativeLink
81+
if: matrix.project == 'rootNative'
82+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/nativeLink
83+
8084
- name: Test
8185
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test
8286

@@ -90,11 +94,11 @@ jobs:
9094

9195
- name: Make target directories
9296
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
93-
run: mkdir -p target .js/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
97+
run: mkdir -p target .js/target core/.native/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
9498

9599
- name: Compress target directories
96100
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
97-
run: tar cf targets.tar target .js/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
101+
run: tar cf targets.tar target .js/target core/.native/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
98102

99103
- name: Upload target directories
100104
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
@@ -167,6 +171,16 @@ jobs:
167171
tar xf targets.tar
168172
rm targets.tar
169173
174+
- name: Download target directories (3.1.3, rootNative)
175+
uses: actions/download-artifact@v2
176+
with:
177+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootNative
178+
179+
- name: Inflate target directories (3.1.3, rootNative)
180+
run: |
181+
tar xf targets.tar
182+
rm targets.tar
183+
170184
- name: Download target directories (2.12.16, rootJS)
171185
uses: actions/download-artifact@v2
172186
with:
@@ -187,6 +201,16 @@ jobs:
187201
tar xf targets.tar
188202
rm targets.tar
189203
204+
- name: Download target directories (2.12.16, rootNative)
205+
uses: actions/download-artifact@v2
206+
with:
207+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootNative
208+
209+
- name: Inflate target directories (2.12.16, rootNative)
210+
run: |
211+
tar xf targets.tar
212+
rm targets.tar
213+
190214
- name: Download target directories (2.13.8, rootJS)
191215
uses: actions/download-artifact@v2
192216
with:
@@ -207,6 +231,16 @@ jobs:
207231
tar xf targets.tar
208232
rm targets.tar
209233
234+
- name: Download target directories (2.13.8, rootNative)
235+
uses: actions/download-artifact@v2
236+
with:
237+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootNative
238+
239+
- name: Inflate target directories (2.13.8, rootNative)
240+
run: |
241+
tar xf targets.tar
242+
rm targets.tar
243+
210244
- name: Import signing key
211245
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
212246
run: echo $PGP_SECRET | base64 -di | gpg --import

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lazy val docs = project
1212

1313
lazy val root = tlCrossRootProject.aggregate(core)
1414

15-
lazy val core = crossProject(JSPlatform, JVMPlatform)
15+
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
1616
.crossType(CrossType.Pure)
1717
.in(file("core"))
1818
.settings(

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
22
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.13")
33
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.13")
4+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")
5+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")

0 commit comments

Comments
 (0)