1
0

chore: Update workflows configuration

This commit is contained in:
Natsu 2024-06-18 17:34:05 +07:00
parent 885abf9275
commit 8dd33c3be3
Signed by: NatsumeLS
GPG Key ID: 6DB67FB460CF46C6
2 changed files with 17 additions and 9 deletions

View File

@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: set up android development environment - name: Setup Android Development Environment
uses: android-actions/setup-android@v2 uses: android-actions/setup-android@v2
- name: Install Dependencies - name: Install Dependencies
@ -25,13 +25,13 @@ jobs:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '21'
- name: Write Branch and Hash info - name: Write Branch and Hash Info
run: | run: |
branch=$(git rev-parse --abbrev-ref HEAD) branch=$(git rev-parse --abbrev-ref HEAD)
hash=$(git rev-parse --short=7 HEAD) hash=$(git rev-parse --short=7 HEAD)
echo "$branch.$hash" > app/src/main/assets/gakumas-local/version.txt 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 run: chmod +x gradlew
- name: Build with Gradle - name: Build with Gradle
@ -48,7 +48,7 @@ jobs:
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
buildToolsVersion: 33.0.0 buildToolsVersion: 33.0.0
- name: Rename signed APK - name: Rename Signed APK
run: | run: |
branch=$(git rev-parse --abbrev-ref HEAD) branch=$(git rev-parse --abbrev-ref HEAD)
hash=$(git rev-parse --short=7 HEAD) hash=$(git rev-parse --short=7 HEAD)

View File

@ -1,32 +1,40 @@
name: Update Submodule name: Update Submodule
on: on:
repository_dispatch: repository_dispatch:
types: types:
- update-submodule - update-submodule
jobs: jobs:
update-submodule: update-submodule:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
steps: steps:
- name: Checkout repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
token: ${{ secrets.PAT }} token: ${{ secrets.PAT }}
submodules: recursive submodules: recursive
- name: Authorize Git - name: Authorize Git
run: | run: |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR" git config --global user.name "$GITHUB_ACTOR"
- name: Update submodule
- name: Update Submodule
run: | run: |
git submodule update --init --recursive --remote -f git submodule update --init --recursive --remote -f
env: env:
GITHUB_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Commit changes
- name: Commit Changes
run: | run: |
git commit -am "Update Translation Data to latest commit" git commit -am "chore(submodule): Update Translation Data"
git push origin main git push origin main
env: env:
GITHUB_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.PAT }}