Skip to content

Commit

Permalink
chore: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mufanc committed Feb 18, 2024
1 parent 51f1763 commit fbbc732
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 79 deletions.
79 changes: 0 additions & 79 deletions .github/workflows/build.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build CI

on:
workflow_dispatch:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.txt'
- '.github/**'
- '!.github/workflows/**'

jobs:
build:
name: Build CI
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout libxposed/api
uses: actions/checkout@v4
with:
repository: libxposed/api
path: libxposed/api
fetch-depth: 0

- name: Checkout libxposed/service
uses: actions/checkout@v4
with:
repository: libxposed/service
path: libxposed/service
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: '17'

- name: Write key
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
run: |
echo "${{ secrets.KEYSTORE }}" | base64 --decode > key.jks
echo keystore.store.file=`pwd`/key.jks >> local.properties
echo keystore.store.password='${{ secrets.KEYSTORE_PASSWORD }}' >> local.properties
echo keystore.key.alias='${{ secrets.KEYSTORE_KEY }}' >> local.properties
echo keystore.key.password='${{ secrets.KEYSTORE_KEY_PASSWORD }}' >> local.properties
- name: Build with Gradle
id: build_apk
run: |
cd libxposed/api && ./gradlew publishToMavenLocal && cd ../..
cd libxposed/service && ./gradlew publishToMavenLocal && cd ../..
./gradlew :app:assemble
echo "debug=$(ls app/build/outputs/apk/debug/*-debug.apk | grep -Po '[^/]*?(?=\.apk)')"
echo "release$(ls app/build/outputs/apk/release/*-release.apk | grep -Po '[^/]*?(?=\.apk)')"
- name: Upload debug
if: success()
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_apk.outputs.debug }}
path: "app/build/outputs/apk/debug/*-debug.apk"

- name: Upload release
if: success()
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_apk.outputs.release }}
path: "app/build/outputs/apk/release/*-release.apk"

- name: Upload mappings
if: success()
uses: actions/upload-artifact@v4
with:
name: mappings
path: "app/build/outputs/mapping/release"

0 comments on commit fbbc732

Please sign in to comment.