Update dependencies (#180) #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Artifacts | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
env: | |
NATIVE_LIB_LOCATION: /tmp/native-libs/ | |
SBT_OPTS: "-Dsbt.ci=true" | |
JAVA_OPTS: "-XX:+UseG1GC -Xms2G -Xmx8G -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8" | |
jobs: | |
check-formatting: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "8" | |
distribution: "zulu" | |
cache: "sbt" | |
- uses: sbt/setup-sbt@v1 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: "clippy, rustfmt" | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: native | |
prefix-key: lint | |
- name: Check all formatting | |
run: | | |
cargo install cargo-sort | |
sbt fmtCheckAll | |
- name: Check doc issues | |
run: sbt makeSite | |
build-natives: | |
name: ${{ matrix.arch }} build | |
runs-on: ${{ matrix.os }} | |
env: | |
TARGET_TRIPLE: ${{ matrix.arch }} | |
needs: [check-formatting] | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- os: ubuntu-latest | |
arch: aarch64-unknown-linux-gnu | |
packages: "sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu" | |
- os: ubuntu-latest | |
arch: x86_64-unknown-linux-gnu | |
packages: "" | |
- os: windows-latest | |
arch: aarch64-pc-windows-msvc | |
packages: "" | |
- os: windows-latest | |
arch: x86_64-pc-windows-msvc | |
packages: "" | |
- os: macos-latest | |
arch: x86_64-apple-darwin | |
packages: "brew install sbt" | |
- os: macos-latest | |
arch: aarch64-apple-darwin | |
packages: "" | |
steps: | |
- name: Install system packages | |
run: ${{ matrix.packages }} | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "8" | |
distribution: "zulu" | |
cache: "sbt" | |
- uses: sbt/setup-sbt@v1 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: native | |
prefix-key: ${{ matrix.arch }} | |
- name: Cross publish artifacts containing native library | |
run: | | |
rustup target add ${{ matrix.arch }} | |
sbt generateNativeLibrary | |
- name: Temporarily save native library for ${{ matrix.arch }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: native_libs-${{ matrix.arch }} | |
path: ${{env.NATIVE_LIB_LOCATION}} | |
retention-days: 1 | |
if-no-files-found: error | |
test-build: | |
name: ${{ matrix.os }} ${{ matrix.java }} test | |
runs-on: ${{ matrix.os }} | |
needs: [build-natives] | |
env: | |
SKIP_NATIVE_GENERATION: true | |
strategy: | |
fail-fast: false | |
matrix: | |
java: ["8", "11", "17", "21"] | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: "zulu" | |
cache: "sbt" | |
- uses: sbt/setup-sbt@v1 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: native_libs-* | |
path: ${{env.NATIVE_LIB_LOCATION}} | |
merge-multiple: true | |
- name: Test for ${{ matrix.os }} ${{ matrix.java }} | |
run: | | |
sbt +assembly | |
java -cp ./examples/target/scala-2.12/scala-polars-examples-assembly-0.1.0-SNAPSHOT.jar examples.scala.io.LazyAndEagerAPI | |
java -cp ./examples/target/scala-2.13/scala-polars-examples-assembly-0.1.0-SNAPSHOT.jar examples.scala.io.LazyAndEagerAPI | |
java -cp ./examples/target/scala-3.3.4/scala-polars-examples-assembly-0.1.0-SNAPSHOT.jar examples.scala.io.LazyAndEagerAPI | |
publish: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
SKIP_NATIVE_GENERATION: true | |
needs: [test-build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "8" | |
distribution: "zulu" | |
cache: "sbt" | |
- uses: sbt/setup-sbt@v1 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: native_libs-* | |
path: ${{env.NATIVE_LIB_LOCATION}} | |
merge-multiple: true | |
- name: List the built artifacts | |
run: ls -lhtR | |
working-directory: ${{env.NATIVE_LIB_LOCATION}} | |
- name: Publish Artifacts | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
run: sbt ci-release | |
- name: Publish API Docs | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "git" | |
sbt ghpagesPushSite |