mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 10:15:18 +08:00
ci: add workflow for push
This commit is contained in:
56
.github/workflows/push_ci.yml
vendored
Normal file
56
.github/workflows/push_ci.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: main
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.txt'
|
||||||
|
- '.github/**'
|
||||||
|
- '!.github/workflows/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build CI
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup cmake
|
||||||
|
uses: jwlawson/actions-setup-cmake@v1.12
|
||||||
|
with:
|
||||||
|
cmake-version: '3.22.1'
|
||||||
|
- name: Prepare Java 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
java-package: jdk
|
||||||
|
- name: Cache Gradle Dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
!~/.gradle/caches/build-cache-*
|
||||||
|
key: gradle-deps-core-${{ hashFiles('**/build.gradle') }}
|
||||||
|
restore-keys: |
|
||||||
|
gradle-deps
|
||||||
|
- name: Cache Gradle Build
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches/build-cache-*
|
||||||
|
key: gradle-builds-core-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
gradle-builds
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: |
|
||||||
|
./gradlew :app:assembleRelease
|
||||||
|
echo "APK_FILE=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: ${{ env.APK_FILE }}
|
||||||
|
name: app-release-${{ github.event.head_commit.id }}
|
Reference in New Issue
Block a user