From bbd1bad95604339ad40e5d64c9c4bb2cf751643e Mon Sep 17 00:00:00 2001 From: Draken <131387159+dragonx943@users.noreply.github.com> Date: Fri, 3 Jan 2025 13:35:54 +0700 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c400c8..5e67937 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,8 @@ jobs: outputs: should_build: ${{ steps.check-updates.outputs.has_changes }} steps: - - id: check-updates + - name: Check for updates 🌏 + id: check-updates run: | last_run=$(curl -s "https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yml/runs?status=completed&per_page=1" | jq -r '.workflow_runs[0].created_at') kotatsu_updated=$(curl -s "https://api.github.com/repos/KotatsuApp/Kotatsu/commits?since=$last_run" | jq '. | length') @@ -39,33 +40,33 @@ jobs: java-version: '17' cache: 'gradle' - - name: Setup Android SDK + - name: Setup Android SDK 💻 uses: android-actions/setup-android@v3 with: android_sdk_version: '35.0.0' android_build_tools_version: '35.0.0' - - name: Pull upstream + - name: Pull upstream 🌏 run: | git remote add upstream https://github.com/KotatsuApp/Kotatsu-Nightly.git git fetch upstream base git reset --hard upstream/base - - name: Grant permissions + - name: Grant permissions 💻 run: chmod a+x gradlew - - name: Generate build number + - name: Generate build number 📆 id: tagger run: | echo "new_tag=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT echo "formatted_date=$(date +'%Y/%m/%d')" >> $GITHUB_OUTPUT - - name: "Build Nightly APK" + - name: Building new APK 💻 run: >- ./gradlew assembleNightly -DparsersVersionOverride=$(curl -s https://api.github.com/repos/kotatsuapp/kotatsu-parsers/commits/master -H "Accept: application/vnd.github.sha" | cut -c -10) - - name: Sign Nightly APK + - name: Packaging new APK 💻 uses: ilharp/sign-android-release@v1 id: sign_app with: @@ -76,12 +77,12 @@ jobs: keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} buildToolsVersion: 35.0.0 - - name: Prepare to Upload + - name: Prepare to Upload 🌏 run: | mv ${{steps.sign_app.outputs.signedFile}} app/build/outputs/apk/nightly/release.apk echo "SIGNED_APK=app/build/outputs/apk/nightly/release.apk" >> $GITHUB_ENV - - name: Get latest changes + - name: Get latest changes 📑 id: changelog run: | CHANGELOG=$(cat CHANGELOG.txt) @@ -89,7 +90,7 @@ jobs: echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Create Release and Upload + - name: Create new GH Release + Uploading 🌏 uses: softprops/action-gh-release@v2 with: tag_name: nightly-${{ steps.tagger.outputs.new_tag }} @@ -113,7 +114,7 @@ jobs: ref: nightly fetch-depth: 0 - - name: Get Build Number + - name: Get Build Number 📆 run: | VERSION_NUMBER="${{ needs.build.outputs.new_tag }}" COUNTER_LINKS="" @@ -124,10 +125,10 @@ jobs: sed -i "/### \[Latest Build Number of Kotatsu Nightly\]/,/^$/c\### [Latest Build Number of Kotatsu Nightly](https://github.com/KotatsuApp/kotatsu-nightly/releases/latest)\n${COUNTER_LINKS}\n" README.md - - name: Update Docs + - name: Update Docs + Commit 🌏 run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" + git config --local user.email "nvasya95@gmail.com" + git config --local user.name "Koitharu" if [[ -n $(git status -s) ]]; then git add README.md git commit -m "Bump build number to ${{ needs.build.outputs.new_tag }}"