Android daily build and publish docs #104
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
name: Android daily build and publish docs | |
on: | |
schedule: | |
# 05:00 AM (KST) Mon-Fri | |
- cron: "00 20 * * 0-4" | |
# Allow manually triggering the workflow | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: ['all', 'lite'] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
id: android-build | |
uses: ./.github/actions/android-build | |
with: | |
build_type: ${{ matrix.build_type }} | |
- name: get date | |
if: always() | |
id: get-date | |
run: | | |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Release daily build result | |
if: steps.android-build.outputs.result == 'success' | |
uses: ./.github/actions/s3_upload | |
with: | |
source: ${{ github.workspace }}/android_lib/ | |
dest: ${{ steps.get-date.outputs.date }}/android/ | |
s3_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
s3_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
s3_option: --recursive | |
- name: Rename latest result | |
if: steps.android-build.outputs.result == 'success' | |
run: | | |
sudo apt install rename | |
mkdir -p ${{ github.workspace }}/android_daily/ | |
cp -r ${{ github.workspace }}/android_lib/* ${{ github.workspace }}/android_daily/ | |
pushd ${{ github.workspace }}/android_daily/ | |
rename 's/-[0-9]{4}-[0-9]{2}-[0-9]{2}//' * | |
popd | |
- name: Release daily build result to latest dir | |
if: steps.android-build.outputs.result == 'success' | |
uses: ./.github/actions/s3_upload | |
with: | |
source: ${{ github.workspace }}/android_daily/ | |
dest: latest/android/ | |
s3_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
s3_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
s3_option: --recursive | |
- name: Generate badge | |
run: | | |
pip install pybadges setuptools | |
mkdir -p ~/daily_build | |
if [ '${{ steps.android-build.outputs.result }}' == 'success' ]; then | |
python3 -m pybadges --left-text=test --right-text=success --right-color=green > ~/daily_build/android_build_result.svg | |
else | |
python3 -m pybadges --left-text=test --right-text=failure --right-color=red > ~/daily_build/android_build_result.svg | |
fi | |
- name: update daily result badge | |
uses: ./.github/actions/gitpush | |
with: | |
source: ~/daily_build/android_build_result.svg | |
dest: testresult | |
message: "Update android daily build result." | |
taos_account: ${{ secrets.TAOS_ACCOUNT }} | |
taos_account_token: ${{ secrets.TAOS_ACCOUNT_TOKEN }} | |
- name: Generate javadoc | |
if: steps.android-build.outputs.result == 'success' | |
run: | | |
echo "Generate javadoc, ${{ github.workspace }}" | |
mkdir -p ~/javadoc_dir | |
sed -i "s|@BUILD_ANDROID@|//|" ${{ github.workspace }}/java/android/nnstreamer/src/main/java/org/nnsuite/nnstreamer/*.java | |
javadoc -d ~/javadoc_dir -public -splitindex -Xdoclint:none --ignore-source-errors java/android/nnstreamer/src/main/java/org/nnsuite/nnstreamer/* | |
- name: Publish javatoc to release.nnstreamer.com | |
if: steps.android-build.outputs.result == 'success' | |
uses: ./.github/actions/s3_upload | |
with: | |
source: ~/javadoc_dir/ | |
dest: ${{ steps.get-date.outputs.date }}/java_html/ | |
s3_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
s3_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
s3_option: --recursive | |
- name: Publish javatoc to release.nnstreamer.com to latest dir | |
if: steps.android-build.outputs.result == 'success' | |
uses: ./.github/actions/s3_upload | |
with: | |
source: ~/javadoc_dir/ | |
dest: latest/java_html/ | |
s3_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
s3_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
s3_option: --recursive |