Update .github/workflows/build_push.yml
This commit is contained in:
parent
38368f56ac
commit
aa598851ed
1 changed files with 43 additions and 32 deletions
65
.github/workflows/build_push.yml
vendored
65
.github/workflows/build_push.yml
vendored
|
@ -21,16 +21,23 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Prepare job
|
name: Prepare job
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
outputs:
|
outputs:
|
||||||
individualMatrix: ${{ steps.generate-matrices.outputs.individualMatrix }}
|
individualMatrix: ${{ steps.generate-matrices.outputs.individualMatrix }}
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repo
|
- name: Clone repo
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
uses: https://github.com/actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
token: ${{ secrets.BOT_PAT }}
|
token: ${{ secrets.BOT_PAT }}
|
||||||
|
|
||||||
|
- name: Get number of modules
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
projects=(src/*/*)
|
||||||
|
export CI_CHUNK_NUM=${#projects[@]}
|
||||||
|
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Temporary pause because of leak of tj-actions/changed-files
|
# Temporary pause because of leak of tj-actions/changed-files
|
||||||
# - name: Find lib changes
|
# - name: Find lib changes
|
||||||
# id: modified-libs
|
# id: modified-libs
|
||||||
|
@ -42,7 +49,7 @@ jobs:
|
||||||
# safe_output: false
|
# safe_output: false
|
||||||
|
|
||||||
- name: Import GPG key
|
- name: Import GPG key
|
||||||
uses: crazy-max/ghaction-import-gpg@v6 # v6.1.0
|
uses: https://github.com/crazy-max/ghaction-import-gpg@v6 # v6.1.0
|
||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
@ -56,19 +63,9 @@ jobs:
|
||||||
# chmod +x ./.github/scripts/bump-versions.py
|
# chmod +x ./.github/scripts/bump-versions.py
|
||||||
# ./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
|
# ./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
|
||||||
uses: gradle/actions/wrapper-validation@v4
|
|
||||||
|
|
||||||
- name: Get number of modules
|
|
||||||
run: |
|
|
||||||
set -x
|
|
||||||
projects=(src/*/*)
|
|
||||||
|
|
||||||
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- id: generate-matrices
|
- id: generate-matrices
|
||||||
name: Create output matrices
|
name: Create output matrices
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
uses: https://github.com/actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const numIndividualModules = process.env.NUM_INDIVIDUAL_MODULES;
|
const numIndividualModules = process.env.NUM_INDIVIDUAL_MODULES;
|
||||||
|
@ -83,27 +80,32 @@ jobs:
|
||||||
build_individual:
|
build_individual:
|
||||||
name: Build individual modules
|
name: Build individual modules
|
||||||
needs: prepare
|
needs: prepare
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix: ${{ fromJSON(needs.prepare.outputs.individualMatrix) }}
|
matrix: ${{ fromJSON(needs.prepare.outputs.individualMatrix) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout main branch
|
- name: Checkout main branch
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
uses: https://github.com/actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
|
uses: https://github.com/actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 17
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
|
|
||||||
|
- name: Set up Android SDK
|
||||||
|
uses: https://github.com/android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 # v3
|
||||||
|
with:
|
||||||
|
packages: ""
|
||||||
|
|
||||||
- name: Prepare signing key
|
- name: Prepare signing key
|
||||||
run: |
|
run: |
|
||||||
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
|
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
|
||||||
|
|
||||||
- name: Set up Gradle
|
- name: Set up Gradle
|
||||||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3
|
uses: https://github.com/gradle/actions/setup-gradle@245c8a24de79c0dbeabaf19ebcbbd3b2c36f278d # v4
|
||||||
|
|
||||||
- name: Build extensions (chunk ${{ matrix.chunk }})
|
- name: Build extensions (chunk ${{ matrix.chunk }})
|
||||||
env:
|
env:
|
||||||
|
@ -114,7 +116,7 @@ jobs:
|
||||||
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
|
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
|
||||||
|
|
||||||
- name: Upload APKs (chunk ${{ matrix.chunk }})
|
- name: Upload APKs (chunk ${{ matrix.chunk }})
|
||||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
|
uses: https://code.forgejo.org/forgejo/upload-artifact@16871d9e8cfcf27ff31822cac382bbb5450f1e1e # v4-patch
|
||||||
if: "github.repository == 'Kohi-den/extensions-source'"
|
if: "github.repository == 'Kohi-den/extensions-source'"
|
||||||
with:
|
with:
|
||||||
name: "individual-apks-${{ matrix.chunk }}"
|
name: "individual-apks-${{ matrix.chunk }}"
|
||||||
|
@ -129,21 +131,30 @@ jobs:
|
||||||
needs:
|
needs:
|
||||||
- build_individual
|
- build_individual
|
||||||
if: "github.repository == 'Kohi-den/extensions-source'"
|
if: "github.repository == 'Kohi-den/extensions-source'"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
|
- name: Setup rsync
|
||||||
|
run: |
|
||||||
|
sudo apt-get update && sudo apt install rsync -y
|
||||||
|
|
||||||
- name: Download APK artifacts
|
- name: Download APK artifacts
|
||||||
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4
|
uses: https://code.forgejo.org/forgejo/download-artifact@d8d0a99033603453ad2255e58720b460a0555e1e # v4-patch
|
||||||
with:
|
with:
|
||||||
path: ~/apk-artifacts
|
path: ~/apk-artifacts
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
|
uses: https://github.com/actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 17
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
|
|
||||||
|
- name: Set up Android SDK
|
||||||
|
uses: https://github.com/android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 # v3
|
||||||
|
with:
|
||||||
|
packages: "build-tools;34.0.0"
|
||||||
|
|
||||||
- name: Checkout main branch
|
- name: Checkout main branch
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
uses: https://github.com/actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
path: main
|
path: main
|
||||||
|
@ -158,7 +169,7 @@ jobs:
|
||||||
python ./.github/scripts/create-repo.py
|
python ./.github/scripts/create-repo.py
|
||||||
|
|
||||||
- name: Checkout repo branch
|
- name: Checkout repo branch
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
uses: https://github.com/actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||||
with:
|
with:
|
||||||
repository: Kohi-den/extensions
|
repository: Kohi-den/extensions
|
||||||
token: ${{ secrets.BOT_PAT }}
|
token: ${{ secrets.BOT_PAT }}
|
||||||
|
@ -170,9 +181,9 @@ jobs:
|
||||||
rsync -a --delete --exclude .git --exclude .gitignore main/repo/ repo --exclude README.md --exclude repo.json
|
rsync -a --delete --exclude .git --exclude .gitignore main/repo/ repo --exclude README.md --exclude repo.json
|
||||||
|
|
||||||
- name: Deploy repo
|
- name: Deploy repo
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: https://github.com/EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: "Update extensions repo"
|
message: "Update extensions repo"
|
||||||
cwd: "./repo"
|
cwd: "./repo"
|
||||||
committer_name: Kohi-den-Bot
|
committer_name: Kohi-den-bot
|
||||||
committer_email: 177773202+Kohi-den-Bot@users.noreply.github.com
|
committer_email: kohi-den-bot@noreply.localhost
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue