Skip to content

Build

Build #186

name: Build
on: workflow_dispatch
#on:
#workflow_dispatch:
#release:
#types:
#- published
# - created
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install Lein
uses: knicknic/os-specific-run@v1.0.3
with:
macos: brew install leiningen
linux: echo "lein is already installed"
- name: Run Tests then Uberjar
run: |
lein run
lein uberjar
echo "Generated JAR files:"
ls -l target/*.jar
- name: Upload Uberjar
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: "https://uploads.github.com/repos/juji-io/datalevin/releases/187436447/assets{?name,label}"
asset_path: target/datalevin-0.9.14-standalone.jar
#asset_path: target/datalevin-${{ github.event.release.tag_name }}-standalone.jar
overwrite: true
- name: Setup Graalvm
uses: DeLaGuardo/setup-graalvm@master
with:
graalvm-version: '22.3.1.java11'
- name: Install Native Image
run: |
gu install native-image
- name: Build Native Datalevin
uses: knicknic/os-specific-run@v1.0.3
with:
macos: |
cd native
bash script/compile
linux: |
cd native
sudo bash script/setup-musl
bash script/compile-static
- name: Run Native Tests
run: |
native/dtlv-test0
- name: Zip Binary
run: |
cd native
7z a -tzip dtlv-0.9.14-${{ matrix.os}}-amd64.zip dtlv
#7z a -tzip dtlv-${{ github.event.release.tag_name }}-${{ matrix.os}}-amd64.zip dtlv
- name: Upload Binary
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: "https://uploads.github.com/repos/juji-io/datalevin/releases/187436447/assets{?name,label}"
#asset_path: native/dtlv-${{ github.event.release.tag_name }}-${{ matrix.os }}-amd64.zip
asset_path: native/dtlv-0.9.14-${{ matrix.os }}-amd64.zip
overwrite: true