From 8dd33c3be37fc362288a030cd86ec70230c83fd7 Mon Sep 17 00:00:00 2001 From: Natsu Date: Tue, 18 Jun 2024 17:34:05 +0700 Subject: [PATCH] chore: Update workflows configuration --- .github/workflows/build.yml | 8 ++++---- .github/workflows/update.yml | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3162423..2577aa6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - name: set up android development environment + - name: Setup Android Development Environment uses: android-actions/setup-android@v2 - name: Install Dependencies @@ -25,13 +25,13 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Write Branch and Hash info + - name: Write Branch and Hash Info run: | branch=$(git rev-parse --abbrev-ref HEAD) hash=$(git rev-parse --short=7 HEAD) echo "$branch.$hash" > app/src/main/assets/gakumas-local/version.txt - - name: Grant execute permission for Gradlew + - name: Grant Execute Permission for Gradlew run: chmod +x gradlew - name: Build with Gradle @@ -48,7 +48,7 @@ jobs: keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} buildToolsVersion: 33.0.0 - - name: Rename signed APK + - name: Rename Signed APK run: | branch=$(git rev-parse --abbrev-ref HEAD) hash=$(git rev-parse --short=7 HEAD) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 809e5d4..62c3690 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,32 +1,40 @@ name: Update Submodule + on: repository_dispatch: types: - update-submodule + jobs: update-submodule: + runs-on: ubuntu-latest + permissions: contents: write pull-requests: write + steps: - - name: Checkout repository + - name: Checkout Repository uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} submodules: recursive + - name: Authorize Git run: | git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" git config --global user.name "$GITHUB_ACTOR" - - name: Update submodule + + - name: Update Submodule run: | git submodule update --init --recursive --remote -f env: GITHUB_TOKEN: ${{ secrets.PAT }} - - name: Commit changes + + - name: Commit Changes run: | - git commit -am "Update Translation Data to latest commit" + git commit -am "chore(submodule): Update Translation Data" git push origin main env: - GITHUB_TOKEN: ${{ secrets.PAT }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.PAT }}