build all and publish jar #28
This file contains 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
# This workflow will build Speedb library on Mac i86 and ARM, Ubuntu i86 and Arm, Windows i86. Then build a jar and publish to Maven central | |
# | |
name: build all and publish jar | |
on: | |
workflow_dispatch: | |
jobs: | |
pre_build: | |
runs-on: ubu4mvn | |
env: | |
VERSION_FILE: speedb/version.h | |
outputs: | |
out1: ${{ steps.find_version.outputs.verSion }} | |
steps: | |
- name: 'Cleanup build folder' | |
run: | | |
ls -la ./ | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
ls -la ./ | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v3 | |
- name: 'find_version' | |
id: 'find_version' | |
run: | | |
major=$(grep '_MAJOR\s\+[0-9]\+' "$VERSION_FILE" | sed 's/[^0-9]\+//') && echo $major | |
minor=$(grep '_MINOR\s\+[0-9]\+' "$VERSION_FILE" | sed 's/[^0-9]\+//') && echo $minor | |
patch=$(( $(grep '_PATCH\s\+[0-9]\+' "$VERSION_FILE" | sed 's/[^0-9]\+//') + 1 )) && echo $patch | |
echo "verSion=$major.$minor.$patch" >> $GITHUB_OUTPUT | |
Mac_i86_Bld: | |
needs: pre_build | |
uses: ./.github/workflows/ci_macos.yml | |
with: | |
verSion: ${{ needs.pre_build.outputs.out1 }} | |
Mac_ARM_Bld: | |
needs: pre_build | |
uses: ./.github/workflows/ci_macos_ARM.yml | |
with: | |
verSion: ${{ needs.pre_build.outputs.out1 }} | |
Ubu_ARM_Bld: | |
needs: pre_build | |
uses: ./.github/workflows/bld_java_ubu_arm.yml | |
with: | |
verSion: ${{ needs.pre_build.outputs.out1 }} | |
Windows_Bld: | |
needs: pre_build | |
uses: ./.github/workflows/ci_windows.yml | |
with: | |
verSion: ${{ needs.pre_build.outputs.out1 }} | |
secrets: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_BUCKET: ${{ secrets.AWS_BUCKET }} | |
Build_and_upload: | |
needs: [pre_build, Mac_i86_Bld, Windows_Bld, Ubu_ARM_Bld] | |
runs-on: ubu4mvn | |
env: | |
VERSION_FILE: speedb/version.h | |
VERSION: ${{needs.pre_build.outputs.out1}} | |
outputs: | |
out1: ${{ steps.find_version.outputs.verSion }} | |
steps: | |
- name: 'Cleanup build folder' | |
run: | | |
ls -la ./ | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
ls -la ./ | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v3 | |
- name: 'build' | |
run: | | |
export JAVA_HOME="$(jrunscript -e 'java.lang.System.out.println(java.lang.System.getProperty("java.home"));')" | |
export LIB_JAVA_VERSION=11.0.17 | |
export the_version=${{ steps.find_version.outputs.verSion }} | |
# PORTABLE=1 DEBUG_LEVEL=0 make -j $(nproc) rocksdbjavastatic | |
export SPDB_LIB_DIR=~/spdb_lib && mkdir -p $SPDB_LIB_DIR | |
docker run --rm -v $(readlink -f ${SPDB_LIB_DIR}):/out -i speedb-centos-builder ${{ github.ref_name }} | |
cd java | |
mkdir src/main/resources | |
#cp target/libspeedbjni-linux64.so src/main/resources | |
cp $SPDB_LIB_DIR/libspeedbjni-linux64.so src/main/resources | |
mv $SPDB_LIB_DIR/libspeedbjni-linux64.so{,_$(date '+%d_%m_%Y__%H_%M_%S')} | |
echo "aws s3 --profile nd7 cp --recursive s3://spdb-builder/jar_test/v$VERSION/ java/src/main/resources/" | |
sleep 180 | |
aws s3 --profile nd7 cp --recursive s3://spdb-builder/jar_test/v$VERSION/ src/main/resources/ | |
ls -l src/main/resources/ | |
cp ../../../../../templ/pom.xml . | |
mvn versions:set -DnewVersion=$VERSION-SNAPSHOT | |
mvn deploy -X -e -DskipTests | |
mvn versions:set -DnewVersion=$the_version | |
#mvn clean deploy -P release -X -e -DskipTests | |
- name: show path | |
run: | | |
echo "versions:set -DnewVersion=$VERSION-SNAPSHOT" |