mirror of
https://github.com/lineage-next/gradle-generatebp
synced 2026-11-16 12:29:09 -08:00
* actions/checkout@v3 -> actions/checkout@v4 * actions/setup-java@v3 -> actions/setup-java@v4
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: Build
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --global user.name "github-actions[bot]"
|
|
|
|
- name: Setup JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 17
|
|
cache: 'gradle'
|
|
|
|
- name: Build
|
|
run: ./gradlew build
|
|
|
|
- name: Publish
|
|
run: |
|
|
rm -rf $GITHUB_WORKSPACE/.m2 || true
|
|
./gradlew \
|
|
-Dmaven.repo.local=$GITHUB_WORKSPACE/.m2 \
|
|
publishToMavenLocal
|
|
find $GITHUB_WORKSPACE/.m2 \
|
|
-type f \
|
|
-name maven-metadata-local.xml \
|
|
-execdir mv {} maven-metadata.xml \;
|
|
|
|
- name: Generate Android.bp for example app
|
|
working-directory: example
|
|
run: |
|
|
./gradlew \
|
|
-Dmaven.repo.local=$GITHUB_WORKSPACE/.m2 \
|
|
app:generateBp
|
|
if [[ ! -z $(git status -s .) ]]; then
|
|
git status
|
|
exit -1
|
|
fi
|
|
|
|
- name: Commit changes
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
git add .m2
|
|
git commit -m "Publish maven artifacts" || true
|
|
|
|
- name: Push changes to repo
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
branch: ${{ github.ref }}
|