Skip to content

Commit

Permalink
Merge pull request #4 from alexarchambault/fix-build
Browse files Browse the repository at this point in the history
  • Loading branch information
jvican authored May 26, 2022
2 parents 1c6ba5c + 6562ce0 commit d80af59
Show file tree
Hide file tree
Showing 21 changed files with 741 additions and 360 deletions.
11 changes: 11 additions & 0 deletions .github/scripts/gpg-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eu

# from https://github.com/coursier/apps/blob/f1d2bf568bf466a98569a85c3f23c5f3a8eb5360/.github/scripts/gpg-setup.sh

echo "$PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes

echo "allow-loopback-pinentry" >>~/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >>~/.gnupg/gpg.conf

gpg-connect-agent reloadagent /bye
107 changes: 83 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- master
tags:
- "v*"
pull_request:

jobs:
Expand All @@ -12,34 +14,91 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
jdk: [[email protected]]
name: Test ${{ matrix.os }} -- ${{ matrix.jdk }}
name: Test ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: coursier/cache-action@v3
- uses: olafurpg/setup-scala@v10
fetch-depth: 0
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
java-version: ${{ matrix.jdk }}
- uses: actions/setup-node@v1
jvm: 8
- name: Compile and test
run: ./mill __.test
- name: Compile to native
run: ./mill show nativeImage
- name: Copy JVM launcher
run: ./mill -i ci.copyJvmLauncher artifacts/
if: runner.os == 'Linux'
- name: Copy launcher
run: ./mill -i ci.copyLauncher artifacts/
- uses: actions/upload-artifact@v3
with:
name: launchers
path: artifacts/
if-no-files-found: error
retention-days: 2

format:
runs-on: ubuntu-latest
name: Format
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
node-version: "10.x"
- name: Set up environment
run: |
curl -Lo coursier https://git.io/coursier-cli && chmod +x coursier && ./coursier --help
yarn --help
java -version
shell: bash
jvm: 8
apps: scalafmt
- name: Check formatting
if: matrix.os != 'windows-latest'
run: |
./bin/scalafmt --test
- name: Compile and test jsonrpc4s
run: |
sbt "+test"
- name: Compile to native
if: matrix.os != 'windows-latest'
run: |
gu install native-image
sbt "snailgun-cli/graalvm-native-image:packageBin"
run: scalafmt --test

publish:
needs: [format, test]
runs-on: ubuntu-latest
name: Publish
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: 8
- name: GPG setup
run: .github/scripts/gpg-setup.sh
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Publish
run: ./mill ci.publishSonatype __.publishArtifacts
env:
PGP_PASSWORD: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

launchers:
needs: [format, test]
name: Upload launchers
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: 8
- uses: actions/download-artifact@v3
with:
name: launchers
path: artifacts/
- run: ./mill -i ci.uploadLaunchers artifacts/
env:
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .mill-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.10.2
5 changes: 3 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
maxColumn = 100
docstrings = JavaDoc
docstrings.style = "Asterisk"
assumeStandardLibraryStripMargin = true
align.tokens=[]
align.openParenCallSite = false
align.openParenDefnSite = false
binPack.literalArgumentLists = true
version = "2.7.3"
version = "3.5.2"
runner.dialect = scala213
44 changes: 0 additions & 44 deletions build.sbt

This file was deleted.

Loading

0 comments on commit d80af59

Please sign in to comment.