update workflow

This commit is contained in:
Cuong-Tran
2025-01-12 14:25:53 +07:00
parent c207fe6c8c
commit 9e4e1004c2
5 changed files with 157 additions and 74 deletions

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

32
.github/renovate.json vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"labels": ["Dependencies"],
"rebaseWhen": "conflicted",
"extends": [
":semanticCommits",
"config:best-practices"
],
"includePaths": [
"buildSrc/gradle/**",
"gradle/**",
".github/**"
],
"ignoreDeps": ["aniyomiorg/issue-moderator-action"],
"packageRules": [
{
"matchManagers": ["github-actions"],
"groupName": "{{manager}} dependencies"
},
{
"matchManagers": ["gradle"],
"enabled": false
},
{
"matchPackageNames": [
"com.android.tools.build:gradle",
"gradle"
],
"draftPR": true,
"enabled": true
}
]
}

View File

@@ -25,9 +25,6 @@ jobs:
- name: Clone repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@a494d935f4b56874c4a5a87d19af7afcf3a163d0 # v2
- name: Get number of modules
run: |
set -x

View File

@@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.BOT_PAT }}
- name: Find lib changes
id: modified-libs
@@ -48,14 +48,12 @@ jobs:
git_user_signingkey: true
git_commit_gpgsign: true
# This step is going to commit, but this will not trigger another workflow.
- name: Bump extensions that uses a modified lib
if: steps.modified-libs.outputs.any_changed == 'true'
run: |
./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@a494d935f4b56874c4a5a87d19af7afcf3a163d0 # v2
# # This step is going to commit, but this will not trigger another workflow.
# - name: Bump extensions that uses a modified lib
# if: steps.modified-libs.outputs.any_changed == 'true'
# run: |
# chmod +x ./.github/scripts/bump-versions.py
# ./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
- name: Get number of modules
run: |
@@ -97,7 +95,8 @@ jobs:
distribution: temurin
- name: Prepare signing key
run: echo "${{ secrets.SIGNING_KEY }}" | base64 --decode > signingkey.jks
run: |
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
- name: Set up Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3
@@ -108,10 +107,11 @@ jobs:
ALIAS: ${{ secrets.ALIAS }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: ./gradlew -p src assembleRelease
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
- name: Upload APKs (chunk ${{ matrix.chunk }})
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
if: github.repository == 'aniku-app/aniku-extensions'
with:
name: "individual-apks-${{ matrix.chunk }}"
path: "**/*.apk"
@@ -124,6 +124,7 @@ jobs:
name: Publish repo
needs:
- build_individual
if: github.repository == 'aniku-app/aniku-extensions'
runs-on: ubuntu-latest
steps:
- name: Download APK artifacts
@@ -147,7 +148,7 @@ jobs:
run: |
cd master
python ./.github/scripts/move-apks.py
INSPECTOR_LINK="$(curl -s "https://api.github.com/repos/Dark25/aniyomi-extensions-inspector/releases/latest" | jq -r '.assets[0].browser_download_url')"
INSPECTOR_LINK="$(curl -s "https://api.github.com/repos/aniyomiorg/aniyomi-extensions-inspector/releases/latest" | jq -r '.assets[0].browser_download_url')"
curl -L "$INSPECTOR_LINK" -o ./Inspector.jar
java -jar ./Inspector.jar "repo/apk" "output.json" "tmp"
python ./.github/scripts/create-repo.py
@@ -155,22 +156,36 @@ jobs:
- name: Checkout repo branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
repository: Dark25/aniyomi-extensions
token: ${{ secrets.GITHUB_TOKEN }}
repository: aniku-app/extensions
token: ${{ secrets.BOT_PAT }}
ref: repo
path: repo
- name: Sync repo
run: |
rsync -a --delete --exclude .git --exclude .gitignore master/repo/ repo --exclude README.md --exclude repo.json
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6 # v6.1.0
id: import-gpg
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6
with:
workdir: repo
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
workdir: repo
- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import-gpg.outputs.keyid }}"
echo "name: ${{ steps.import-gpg.outputs.name }}"
echo "email: ${{ steps.import-gpg.outputs.email }}"
- name: Deploy repo
run: |
cd repo
chmod +x ../master/.github/scripts/commit-repo.sh
../master/.github/scripts/commit-repo.sh
uses: EndBug/add-and-commit@v9
with:
message: "Update extensions repo"
cwd: "./repo"
committer_name: ${{ steps.import-gpg.outputs.name }}
committer_email: ${{ steps.import-gpg.outputs.email }}

View File

@@ -1,68 +1,96 @@
name: Update Upstream
on:
# Monthly
schedule:
- cron: '0 0 * * *'
# Manual trigger
workflow_dispatch:
inputs:
# Monthly
schedule:
- cron: '0 0 * * *'
# Manual trigger
workflow_dispatch:
inputs:
jobs:
update-kohi-den:
name: Update Kohi-den
runs-on: ubuntu-latest
update-dark25:
name: Update Dark25
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "UPSTREAM_URL=https://github.com/Kohi-den/extensions-source.git" >> $GITHUB_ENV
echo "UPSTREAM_BRANCH=main" >> $GITHUB_ENV
echo "LOCAL_BRANCH=kohiden" >> $GITHUB_ENV
steps:
- name: Set env
run: |
echo "UPSTREAM_URL=https://github.com/Dark25/aniyomi-extensions.git" >> $GITHUB_ENV
echo "UPSTREAM_BRANCH=master" >> $GITHUB_ENV
echo "LOCAL_BRANCH=dark25" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{env.LOCAL_BRANCH}}
token: ${{ secrets.BOT_PAT }}
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{env.LOCAL_BRANCH}}
token: ${{ secrets.BOT_PAT }}
- name: Add remote repository
run: git remote add upstream ${{env.UPSTREAM_URL}}
- name: Add remote repository
run: git remote add upstream ${{env.UPSTREAM_URL}}
- name: Fetch upstream changes
run: git fetch upstream
- name: Fetch upstream changes
run: git fetch upstream
- name: Merge upstream changes
run: git merge upstream/${{env.UPSTREAM_BRANCH}}
- name: Merge upstream changes
run: git merge upstream/${{env.UPSTREAM_BRANCH}}
- name: Push changes to repository
run: git push origin ${{env.LOCAL_BRANCH}}
- name: Push changes to repository
run: git push origin ${{env.LOCAL_BRANCH}}
update-dark25:
name: Update Dark25
runs-on: ubuntu-latest
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6 # v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
steps:
- name: Set env
run: |
echo "UPSTREAM_URL=https://github.com/Dark25/aniyomi-extensions.git" >> $GITHUB_ENV
echo "UPSTREAM_BRANCH=master" >> $GITHUB_ENV
echo "LOCAL_BRANCH=dark25" >> $GITHUB_ENV
- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import-gpg.outputs.keyid }}"
echo "name: ${{ steps.import-gpg.outputs.name }}"
echo "email: ${{ steps.import-gpg.outputs.email }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{env.LOCAL_BRANCH}}
token: ${{ secrets.BOT_PAT }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_PAT }}
- name: Add remote repository
run: git remote add upstream ${{env.UPSTREAM_URL}}
- name: Merge Dark25
run: git merge origin/${{env.LOCAL_BRANCH}}
- name: Fetch upstream changes
run: git fetch upstream
- name: Push main to repository
run: git push origin master
- name: Merge upstream changes
run: git merge upstream/${{env.UPSTREAM_BRANCH}}
update-kohi-den:
name: Update Kohi-den
runs-on: ubuntu-latest
- name: Push changes to repository
run: git push origin ${{env.LOCAL_BRANCH}}
steps:
- name: Set env
run: |
echo "UPSTREAM_URL=https://github.com/Kohi-den/extensions-source.git" >> $GITHUB_ENV
echo "UPSTREAM_BRANCH=main" >> $GITHUB_ENV
echo "LOCAL_BRANCH=kohiden" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{env.LOCAL_BRANCH}}
token: ${{ secrets.BOT_PAT }}
- name: Add remote repository
run: git remote add upstream ${{env.UPSTREAM_URL}}
- name: Fetch upstream changes
run: git fetch upstream
- name: Merge upstream changes
run: git merge upstream/${{env.UPSTREAM_BRANCH}}
- name: Push changes to repository
run: git push origin ${{env.LOCAL_BRANCH}}