Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create distributable cross-platform packages #329

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
129 changes: 64 additions & 65 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,62 @@ name: Release Artifacts
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build-jar:
name: Build Effekt compiler and run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "true"

- uses: actions/checkout@v2
with:
submodules: 'true'

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Install MLton
run: |
curl -L https://github.com/MLton/mlton/releases/download/on-20210117-release/mlton-20210117-1.amd64-linux-glibc2.31.tgz --output mlton.tgz
tar -xzf mlton.tgz
mv mlton-20210117-1.amd64-linux-glibc2.31 $GITHUB_WORKSPACE/mlton
chmod +x $GITHUB_WORKSPACE/mlton/bin/mlton
echo "Trying to call directly"
$GITHUB_WORKSPACE/mlton/bin/mlton
echo "Adding mlton to path"
echo "$GITHUB_WORKSPACE/mlton/bin" >> $GITHUB_PATH

- name: Install Chez Scheme
run: sudo apt-get install chezscheme

- name: Run tests and assemble jar file
run: sbt clean deploy

- id: npmpackage
name: Generate npm package
run: mv $(npm pack) effekt.tgz

- name: Upload the npm package
uses: actions/upload-artifact@v1
with:
name: effekt-npm-package
path: effekt.tgz
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Install MLton
run: |
curl -L https://github.com/MLton/mlton/releases/download/on-20210117-release/mlton-20210117-1.amd64-linux-glibc2.31.tgz --output mlton.tgz
tar -xzf mlton.tgz
mv mlton-20210117-1.amd64-linux-glibc2.31 $GITHUB_WORKSPACE/mlton
chmod +x $GITHUB_WORKSPACE/mlton/bin/mlton
echo "Trying to call directly"
$GITHUB_WORKSPACE/mlton/bin/mlton
echo "Adding mlton to path"
echo "$GITHUB_WORKSPACE/mlton/bin" >> $GITHUB_PATH

- name: Install Chez Scheme
run: sudo apt-get install chezscheme

- name: Run tests and assemble jar file
run: sbt clean deploy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiribenes just told me MacOS minutes are much more expensive. Maybe we don't want to run the tests on all systems??? :)


- id: npmpackage
name: Generate npm package
run: mv $(npm pack) effekt.tgz

- name: Upload the npm package
uses: actions/upload-artifact@v1
with:
name: effekt-npm-package
path: effekt.tgz

build-native:
name: Build native image
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-13, ubuntu-latest, windows-latest]
os: [macos-13, ubuntu-latest, windows-latest]
include:
- os: macOS-latest
- os: macos-13
uploaded_filename: effekt-arm64-apple-darwin
local_path: effekt/jvm/target/native-image/effekt
- os: ubuntu-latest
Expand All @@ -70,28 +69,28 @@ jobs:
uploaded_filename: effekt-x86_64-pc-win32.exe
local_path: effekt\jvm\target\native-image\effekt.exe
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Run tests and build native image
run: sbt clean effektJVM/native-image

- name: Upload Effekt native image
uses: actions/upload-artifact@v2
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}
- uses: actions/checkout@v2
with:
submodules: "true"

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Run tests and build native image
run: sbt clean effektJVM/native-image

- name: Upload Effekt native image
uses: actions/upload-artifact@v2
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}

release:
name: Create Release
Expand Down
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ lazy val effekt: CrossProject = crossProject(JSPlatform, JVMPlatform).in(file("e
"--no-fallback",
"--initialize-at-build-time",
"--report-unsupported-elements-at-runtime",
"-H:DynamicProxyConfigurationFiles=../../../../project/dynamic-proxies.json"
"-H:DynamicProxyConfigurationFiles=../../native-image/dynamic-proxies.json",
"-H:ReflectionConfigurationFiles=../../native-image/reflect-config.json",
"-H:+ReportExceptionStackTraces",
"-H:IncludeResourceBundles=jline.console.completer.CandidateListCompletionHandler",
),

// Assembling one big jar-file and packaging it
Expand Down
23 changes: 12 additions & 11 deletions effekt/jvm/native-image/reflect-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
},
{
"name":"kiama.util.SetTraceNotificationParams",
"allDeclaredFields":true
"allDeclaredFields":true,
"allPublicConstructors":true
},
{
"name":"org.eclipse.lsp4j.CallHierarchyCapabilities",
Expand Down Expand Up @@ -221,6 +222,11 @@
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.DocumentFormattingParams",
"allDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.DocumentHighlightCapabilities",
"allDeclaredFields":true,
Expand Down Expand Up @@ -273,6 +279,11 @@
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.ExecuteCommandParams",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.FoldingRangeCapabilities",
"allDeclaredFields":true,
Expand Down Expand Up @@ -420,16 +431,6 @@
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.SemanticHighlightingCapabilities",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.SemanticHighlightingServerCapabilities",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"org.eclipse.lsp4j.ServerCapabilities",
"allDeclaredFields":true,
Expand Down
1 change: 0 additions & 1 deletion project/dynamic-proxies.json

This file was deleted.

Loading