Skip to content

add xterm

add xterm #406

Workflow file for this run

name: Build and Upload JARs
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
release_name: snapshot-linux
- os: windows-2019
release_name: snapshot-windows
- os: macos-14
release_name: snapshot-macos
- os: macos-12
release_name: snapshot-macos-intel
env:
SCALA_VERSION: '3.5.0'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
working-directory: ./
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Pick and display a JDK version and distribution
id: pick-jdk
run: |
JDK_VERSION=8
if [[ "$RUNNER_OS" == "macOS" && "$RUNNER_ARCH" == "ARM64" ]]; then
JDK_VERSION=11
fi
JDK_DISTRIBUTION=temurin
echo "JDK_VERSION=$JDK_VERSION" >> $GITHUB_ENV
echo "JDK_DISTRIBUTION=$JDK_DISTRIBUTION" >> $GITHUB_ENV
shell: bash
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: ${{ env.JDK_VERSION }}
cache: sbt
- uses: sbt/setup-sbt@v1
- name: Cache SBT (Unix)
if: runner.os != 'Windows'
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache
~/.sbt
~/.coursier
~/.cache/coursier
key: ${{ matrix.os }}-sbt-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ matrix.os }}-sbt-
- name: Cache SBT for Windows
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: |
C:\Users\runneradmin\.ivy2\cache
C:\Users\runneradmin\.sbt
C:\Users\runneradmin\.coursier
C:\Users\runneradmin\AppData\Local\Coursier\cache
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-
- name: Clone scala-graph and publishM2 (for Java8 and Scala Native)
run: |
git clone https://github.com/mio-19/scala-graph
cd scala-graph
git checkout 6381eb20c8595f5507410f4e2bfa9e27b8d88a30
sbt publishM2
shell: bash
- name: SBT Clean
run: sbt clean
# for some reason clean calls stImport and stImport usually fails at first run
continue-on-error: true
# maybe test will fail on the first try because of stImport, the typescript to scala thing.
- name: Run Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 25
max_attempts: 3
shell: bash
command: sbt test
- name: Build Common JAR with SBT
run: sbt common/assembly
- name: Build CLI JAR with SBT
run: sbt cli/assembly
- name: Build LSP JAR with SBT
run: sbt lsp/assembly
- name: Build CLI Native Executable
run: sbt cliNative/nativeLink
- name: Rename CLI Native Executable
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
mv cli/native/target/scala-${{ env.SCALA_VERSION }}/cli-out.exe cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out.exe || mv cli/native/target/scala-${{ env.SCALA_VERSION }}/native/chester.cli.Main.exe cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out.exe
else
mv cli/native/target/scala-${{ env.SCALA_VERSION }}/cli-out cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out || mv cli/native/target/scala-${{ env.SCALA_VERSION }}/native/chester.cli.Main cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out
fi
- name: Generate JS Artifacts for CLI
run: |
sbt cliJS/fullLinkJS
mv cli/js/target/scala-${{ env.SCALA_VERSION }}/cli-opt/main.js cli/js/target/scala-${{ env.SCALA_VERSION }}/chester.js
- uses: graalvm/setup-graalvm@v1
with:
java-version: '22'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: GraalVM Env
run: |
echo "NATIVE_IMAGE_INSTALLED=true" >> $GITHUB_ENV
echo "GRAALVM_INSTALLED=true" >> $GITHUB_ENV
- name: Build Native Image for LSP
run: sbt lsp/nativeImage
- name: Build Native Image for CLI
run: sbt cli/nativeImage
- name: Test Native Image for CLI integrity
run: ./target/chester integrity
- name: List files for debugging
run: find . -type f -name "*.jar" -or -name "chester" -or -name "chester-lsp" -or -name "chester-out" -or -name "*.exe"
continue-on-error: true
- name: Upload Unix Artifacts
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.release_name }}
path: |
./common/jvm/target/scala-${{ env.SCALA_VERSION }}/common.jar
./cli/jvm/target/scala-${{ env.SCALA_VERSION }}/chester.jar
./lsp/.jvm/target/scala-${{ env.SCALA_VERSION }}/chester-lsp.jar
./cli/js/target/scala-${{ env.SCALA_VERSION }}/chester.js
./target/chester
./target/chester-lsp
./cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out
- name: Upload Windows Artifacts
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.release_name }}
path: |
./common/jvm/target/scala-${{ env.SCALA_VERSION }}/common.jar
./cli/jvm/target/scala-${{ env.SCALA_VERSION }}/chester.jar
./lsp/.jvm/target/scala-${{ env.SCALA_VERSION }}/chester-lsp.jar
./cli/js/target/scala-${{ env.SCALA_VERSION }}/chester.js
./target/chester.exe
./target/chester-lsp.exe
./cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out.exe
- name: Create or Update GitHub Release for Unix
if: runner.os != 'Windows'
uses: ncipollo/release-action@v1
with:
tag: ${{ matrix.release_name }}
name: ${{ matrix.release_name }}
allowUpdates: true
prerelease: true
artifacts: |
./common/jvm/target/scala-${{ env.SCALA_VERSION }}/common.jar,
./cli/jvm/target/scala-${{ env.SCALA_VERSION }}/chester.jar,
./lsp/.jvm/target/scala-${{ env.SCALA_VERSION }}/chester-lsp.jar,
./cli/js/target/scala-${{ env.SCALA_VERSION }}/chester.js,
./target/chester,
./target/chester-lsp,
./cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out
- name: Create or Update GitHub Release for Windows
if: runner.os == 'Windows'
uses: ncipollo/release-action@v1
with:
tag: ${{ matrix.release_name }}
name: ${{ matrix.release_name }}
allowUpdates: true
prerelease: true
artifacts: |
./common/jvm/target/scala-${{ env.SCALA_VERSION }}/common.jar,
./cli/jvm/target/scala-${{ env.SCALA_VERSION }}/chester.jar,
./lsp/.jvm/target/scala-${{ env.SCALA_VERSION }}/chester-lsp.jar,
./cli/js/target/scala-${{ env.SCALA_VERSION }}/chester.js,
./target/chester.exe,
./target/chester-lsp.exe,
./cli/native/target/scala-${{ env.SCALA_VERSION }}/chester-out.exe