Use bonej-plus jars from bonej-plus repo during CI builds #86
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: build PR | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'zulu' | |
cache: 'maven' | |
- name: Get BoneJ-plus asset ID from GitHub Release | |
id: get_bonej_plus_asset | |
run: | | |
ASSET_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.BONEJ_PLUS_REPO }}" \ | |
https://api.github.com/repos/bonej-org/BoneJ-plus/releases/tags/bonej-plus-0.0.3 | \ | |
jq '.assets[] | select(.name=="bonej-plus-0.0.3.jar") | .id') | |
echo "asset_id=$ASSET_ID" >> $GITHUB_ENV | |
- name: Download BoneJ-plus JAR by asset ID | |
run: | | |
curl -L \ | |
-H "Authorization: Bearer ${{ secrets.BONEJ_PLUS_REPO }}" \ | |
-H "Accept: application/octet-stream" \ | |
https://api.github.com/repos/bonej-org/BoneJ-plus/releases/assets/${{ env.asset_id }} \ | |
-o bonej-plus-0.0.3.jar | |
- name: Install BoneJ-plus into local Maven repository | |
run: | | |
mvn install:install-file \ | |
-Dfile=bonej-plus-0.0.3.jar \ | |
-DgroupId=org.bonej \ | |
-DartifactId=bonej-plus \ | |
-Dversion=0.0.3 \ | |
-Dpackaging=jar | |
- name: Set up CI environment | |
run: .github/setup.sh | |
- name: Execute the build | |
run: .github/build.sh |