Skip to content

Commit

Permalink
actions: Only package the module after everything is built
Browse files Browse the repository at this point in the history
  • Loading branch information
iscle committed Sep 3, 2023
1 parent b45b01d commit 69f6395
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,9 @@ jobs:
run: |
mv libv4a_re.so libv4a_re_${{ matrix.abi }}.so
# Move compiled libraries into the Magisk module folder
- name: Move to Magisk Module
run: |
mkdir -p module/common/files/${{ matrix.abi }}
mv libv4a_re_${{ matrix.abi }}.so module/common/files/${{ matrix.abi }}/
# Zip the Magisk module folder
- name: Zip Magisk Module
run: |
cd module
zip -r ../magisk_module.zip ./
# Upload the Magisk module zip as an artifact
- name: Upload Magisk Module
uses: actions/upload-artifact@v3
with:
name: magisk_module
path: magisk_module.zip

# Upload compiled libraries as an artifact
- name: Upload compiled libraries
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: compiled-binaries
path: libv4a_re_*.so
path: |
libv4a_re_*.so
43 changes: 43 additions & 0 deletions .github/workflows/package-magisk-module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Package Magisk Module

on:
workflow_run:
workflows: ["build"]
types:
- completed

jobs:
package:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

# Download the compiled binaries from the 'build' workflow
- name: Download compiled libraries
uses: actions/download-artifact@v3
with:
name: compiled-binaries
path: compiled/

# Prepare Magisk module directory by copying the necessary ABI files
- name: Prepare Magisk Module
run: |
for abi in armeabi-v7a arm64-v8a x86 x86_64; do
mkdir -p module/common/files/$abi
cp compiled/libv4a_re_$abi.so module/common/files/$abi/
done
# Zip the Magisk module
- name: Zip Magisk Module
run: |
cd module
zip -r ../magisk_module.zip ./
# Upload the zipped Magisk module as an artifact
- name: Upload Magisk Module
uses: actions/upload-artifact@v3
with:
name: magisk_module
path: magisk_module.zip

0 comments on commit 69f6395

Please sign in to comment.