Skip to content

Commit

Permalink
Use native image of FindNewReleases in CD (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkoenig authored Aug 6, 2024
1 parent 2c7faa0 commit 7b988cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/scripts/FindNewReleases.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//> using dep "io.get-coursier::coursier:2.1.10"
//> using dep "com.lihaoyi::upickle:3.3.1"
//> using options "-unchecked", "-deprecation", "-feature", "-Xcheckinit", "-Xfatal-warnings", "-Ywarn-dead-code", "-Ywarn-unused"
//> using packaging.graalvmArgs "--enable-url-protocols=https"

import cats.effect.IO
import cats.effect.unsafe.implicits.global
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/cd-llvm-firtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Java
run: echo "JAVA_HOME=${JAVA_HOME_17_X64}" >> "$GITHUB_ENV"
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@v1
- name: Cache FindNewReleases
uses: actions/cache@v3
id: docache
with:
jvm: '' # Deliberately empty to avoid downloading JVM.
path: FindNewReleases
key: ${{ runner.os }}-FindNewReleases-${{ hashFiles('.github/scripts/FindNewReleases.scala') }}
# Dont bother caching Scala build, we rarely need to rebuild FindNewReleases
- name: Setup Scala
uses: VirtusLab/scala-cli-setup@v1
if: steps.docache.outputs.cache-hit != 'true'
with:
jvm: 'graalvm-community:21.0.2'
- name: Compile FindNewReleases
if: steps.docache.outputs.cache-hit != 'true'
run: |
scala-cli --power package --graal --graalvm-java-version 21 --graalvm-version 21.0.2 --force -o FindNewReleases .github/scripts/FindNewReleases.scala
- id: detect-versions
run: |
# --server=false avoids an hang.
versions=$(scala-cli --server=false .github/scripts/FindNewReleases.scala)
versions=$(./FindNewReleases)
echo "versions=$versions" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 7b988cf

Please sign in to comment.