Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonx943 authored Jan 3, 2025
1 parent 9264c79 commit bbd1bad
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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:
Expand All @@ -76,20 +77,20 @@ 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)
echo "content<<EOF" >> $GITHUB_OUTPUT
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 }}
Expand All @@ -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=""
Expand All @@ -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 }}"
Expand Down

0 comments on commit bbd1bad

Please sign in to comment.