Skip to content

Merge pull request #2975 from bishabosha/version-overrides-launcherType #2202

Merge pull request #2975 from bishabosha/version-overrides-launcherType

Merge pull request #2975 from bishabosha/version-overrides-launcherType #2202

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
compile-all:
runs-on: ubuntu-latest
name: Compile everything
steps:
- name: Don't convert LF to CRLF during checkout
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: "temurin:17"
version: "2.1.0"
- run: ./mill -i __.compile
compile-all-no-package-object:
runs-on: ubuntu-latest
name: Compile everything (no package object)
steps:
- name: Don't convert LF to CRLF during checkout
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: "temurin:17"
version: "2.1.0"
- run: |
test -e modules/coursier/shared/src/main/scala/coursier/package.scala
rm -f modules/coursier/shared/src/main/scala/coursier/package.scala
./mill -i __.compile
test:
runs-on: ${{ matrix.OS }}
name: ${{ matrix.OS }} Scala ${{ matrix.SCALA_VERSION }} JDK ${{ matrix.JDK }}
strategy:
fail-fast: false
matrix:
OS: ["ubuntu-latest"]
JDK: ["8"]
SCALA_VERSION: ["2.12.18"]
include:
- JDK: "8"
SCALA_VERSION: "2.12.18"
OS: "windows-latest"
- JDK: "8"
SCALA_VERSION: "2.13.12"
OS: "ubuntu-latest"
- JDK: "17"
SCALA_VERSION: "2.12.18"
OS: "ubuntu-latest"
steps:
- name: Don't convert LF to CRLF during checkout
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: ${{ matrix.JDK }}
version: "2.1.0"
- run: sudo apt-get install -y nailgun
if: runner.os == 'Linux'
# - run: .github/scripts/scala-native-setup.sh
# if: runner.os != 'Windows'
- run: ./mill -i jvmTests "$SCALA_VERSION"
shell: bash
env:
SCALA_VERSION: ${{ matrix.SCALA_VERSION }}
COURSIER_JNI: force
js-test:
runs-on: ubuntu-latest
name: Scala.JS Scala ${{ matrix.SCALA_VERSION }}
strategy:
fail-fast: false
matrix:
SCALA_VERSION: ["2.12.18", "2.13.12"]
steps:
- name: Don't convert LF to CRLF during checkout
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v3
with:
node-version: '12'
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: 8
version: "2.1.0"
- run: npm install && ./mill -i jsTests "$SCALA_VERSION"
shell: bash
env:
SCALA_VERSION: ${{ matrix.SCALA_VERSION }}
bin-compat:
runs-on: ubuntu-latest
name: Binary compatibility
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: 8
version: "2.1.0"
- run: ./mill -i -k __.mimaReportBinaryIssues
website-check:
runs-on: ubuntu-latest
name: Website check
steps:
- name: Don't convert LF to CRLF during checkout
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v3
with:
node-version: '12'
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: 17
version: "2.1.0"
- run: ./mill -i doc.generate --npm-install --yarn-run-build
env:
COURSIER_JNI: force
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: 8
apps: scalafmt
version: "2.1.0"
- run: scalafmt --check
publish:
needs: ["compile-all", "test", "js-test", "bin-compat", "website-check", "format"]
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- run: .github/scripts/gpg-setup.sh
env:
PGP_SECRET: ${{ secrets.PUBLISH_SECRET_KEY }}
- uses: coursier/setup-action@v1.3.5
with:
jvm: 8
version: "2.1.0"
- run: |
mv .mill-jvm-opts .mill-jvm-opts.bak
cat .mill-jvm-opts.bak | grep -v -- '-Xmx' > .mill-jvm-opts
echo '-Xmx2g' >> .mill-jvm-opts
- name: Release
run: |
./mill -i publishSonatype __.publishArtifacts || (
echo "Publishing exit with non-zero code, ignoring it" 1>&2
exit 0
)
env:
PGP_PASSWORD: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
PGP_SECRET: ${{ secrets.PUBLISH_SECRET_KEY }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
generate-native-launchers:
name: Test and upload native launcher ${{ matrix.OS }}
runs-on: ${{ matrix.OS }}
strategy:
fail-fast: false
matrix:
OS: ["ubuntu-latest", "windows-latest", "macos-12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- run: sudo apt-get install -y nailgun
if: runner.os == 'Linux'
- run: .github/scripts/maybe-with-graalvm-home.sh nativeTests
shell: bash
- name: Copy artifacts
run: .github/scripts/maybe-with-graalvm-home.sh copyLauncher artifacts/
shell: bash
- name: Build OS packages
run: .github/scripts/generate-os-packages.sh
shell: bash
- uses: actions/upload-artifact@v3
with:
name: launchers
path: artifacts/
if-no-files-found: error
retention-days: 2
generate-native-static-launcher:
name: Test and upload native static launcher
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- run: sudo apt-get install -y nailgun
if: runner.os == 'Linux'
- run: .github/scripts/maybe-with-graalvm-home.sh nativeStaticTests
shell: bash
- name: Copy artifacts
run: .github/scripts/maybe-with-graalvm-home.sh copyStaticLauncher artifacts/
shell: bash
- uses: actions/upload-artifact@v3
with:
name: launchers
path: artifacts/
if-no-files-found: error
retention-days: 2
generate-native-mostly-static-launcher:
name: Test and upload native mostly static launcher
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- run: sudo apt-get install -y nailgun
if: runner.os == 'Linux'
- run: .github/scripts/maybe-with-graalvm-home.sh nativeMostlyStaticTests
shell: bash
- name: Copy artifacts
run: .github/scripts/maybe-with-graalvm-home.sh copyMostlyStaticLauncher artifacts/
shell: bash
- uses: actions/upload-artifact@v3
with:
name: launchers
path: artifacts/
if-no-files-found: error
retention-days: 2
generate-native-container-launcher:
name: Test and upload native container launcher
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- run: sudo apt-get install -y nailgun
if: runner.os == 'Linux'
- run: .github/scripts/maybe-with-graalvm-home.sh nativeContainerTests
shell: bash
- name: Copy artifacts
run: .github/scripts/maybe-with-graalvm-home.sh copyContainerLauncher artifacts/
shell: bash
- uses: actions/upload-artifact@v3
with:
name: launchers
path: artifacts/
if-no-files-found: error
retention-days: 2
generate-jar-launchers:
name: Upload JAR launchers
needs: publish
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- name: Wait for sync to Central
run: ./mill -i waitForSync
- name: Copy artifacts
run: ./mill -i copyJarLaunchers
- uses: actions/upload-artifact@v3
with:
name: launchers
path: artifacts/
if-no-files-found: error
retention-days: 2
upload-launchers:
name: Upload launchers to GitHub release assets
needs: [generate-native-launchers, generate-native-static-launcher, generate-native-mostly-static-launcher, generate-native-container-launcher, generate-jar-launchers]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- uses: actions/download-artifact@v3
with:
name: launchers
path: artifacts/
- run: ./mill -i uploadLaunchers artifacts/
env:
UPLOAD_GH_TOKEN: ${{ secrets.GH_TOKEN }}
update-brew-formula:
name: Update brew formula
needs: [upload-launchers]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 8
version: "2.1.0"
- run: .github/scripts/scala-cli.sh .github/scripts/UpdateBrewFormula.scala
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
update-website-latest:
name: Update website (snapshot)
needs: publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v3
with:
node-version: '12'
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.0
with:
jvm: 17
version: "2.1.0"
- run: npm install && export PATH="$PATH:$(pwd)/node_modules/bower/bin" && ./mill -i updateWebsite
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
update-website:
name: Update website
needs: update-brew-formula
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v3
with:
node-version: '12'
- uses: coursier/cache-action@v6.4
- uses: coursier/setup-action@v1.3.5
with:
jvm: 17
version: "2.1.0"
- run: npm install && export PATH="$PATH:$(pwd)/node_modules/bower/bin" && ./mill -i updateWebsite
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}