Merge pull request #368 from bonej-org/ci-build #79
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 | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "*-[0-9]+.*" | |
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: Extract bonej-plus version | |
id: extract_version | |
run: | | |
VERSION=$(grep -A 2 '<artifactId>bonej-plus</artifactId>' ./Modern/wrapperPlugins/pom.xml | grep '<version>' | sed -n 's|.*<version>\(.*\)</version>.*|\1|p') | |
echo "Found bonej-plus version $VERSION" | |
echo "bonej_plus_version=$VERSION" >> $GITHUB_ENV | |
- 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-${{env.bonej_plus_version}} | \ | |
jq '.assets[] | select(.name=="bonej-plus-${{env.bonej_plus_version}}.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-${{env.bonej_plus_version}}.jar | |
- name: Install bonej-plus into local Maven repository | |
run: | | |
mvn install:install-file \ | |
-Dfile=bonej-plus-${{env.bonej_plus_version}}.jar \ | |
-DgroupId=org.bonej \ | |
-DartifactId=bonej-plus \ | |
-Dversion=${{env.bonej_plus_version}} \ | |
-Dpackaging=jar | |
- name: Set up CI environment | |
run: .github/setup.sh | |
- name: Execute the build | |
run: .github/build.sh | |
env: | |
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
MAVEN_USER: ${{ secrets.MAVEN_USER }} | |
MAVEN_PASS: ${{ secrets.MAVEN_PASS }} | |
OSSRH_PASS: ${{ secrets.OSSRH_PASS }} | |
SIGNING_ASC: ${{ secrets.SIGNING_ASC }} |