mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 01:54:17 +01:00
Upload artifacts on ci
-labeled PRs only
This commit is contained in:
parent
6599c1dccf
commit
c8a99582c2
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@ -1,14 +1,22 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on: [ push, pull_request ]
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, labeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event.type != 'PullRequestEvent' || contains(github.event.pull_request.labels.*.name, 'ci')
|
# Skip 'labeled' events that didn't add the 'ci' label
|
||||||
|
if: |
|
||||||
|
github.event_name != 'pull_request' ||
|
||||||
|
github.event.action != 'labeled' ||
|
||||||
|
github.event.label.name == 'ci'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JVM_OPTS: -Xmx6G
|
JVM_OPTS: -Xmx6G
|
||||||
IS_SKYLINE_SIGNED: ${{ secrets.KEYSTORE != '' }}
|
IS_SKYLINE_SIGNED: ${{ secrets.KEYSTORE != '' }}
|
||||||
|
UPLOAD_ARTIFACTS: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci') }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Git Checkout
|
- name: Git Checkout
|
||||||
@ -16,7 +24,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
|
||||||
- name: Restore CCache
|
- name: Restore CCache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
@ -41,7 +48,7 @@ jobs:
|
|||||||
run: echo "yes" | $ANDROID_HOME/tools/bin/sdkmanager "cmake;3.22.1" "ndk;25.0.8775105" --channel=3 | grep -v = || true
|
run: echo "yes" | $ANDROID_HOME/tools/bin/sdkmanager "cmake;3.22.1" "ndk;25.0.8775105" --channel=3 | grep -v = || true
|
||||||
|
|
||||||
- name: Decode Keystore
|
- name: Decode Keystore
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
if: env.IS_SKYLINE_SIGNED == 'true'
|
||||||
env:
|
env:
|
||||||
KEYSTORE_ENCODED: ${{ secrets.KEYSTORE }}
|
KEYSTORE_ENCODED: ${{ secrets.KEYSTORE }}
|
||||||
run: echo $KEYSTORE_ENCODED | base64 --decode > "/home/runner/keystore.jks"
|
run: echo $KEYSTORE_ENCODED | base64 --decode > "/home/runner/keystore.jks"
|
||||||
@ -58,40 +65,40 @@ jobs:
|
|||||||
run: ./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand assembleFull
|
run: ./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand assembleFull
|
||||||
|
|
||||||
- name: Rename APKs (Signed)
|
- name: Rename APKs (Signed)
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
if: env.IS_SKYLINE_SIGNED == 'true' && env.UPLOAD_ARTIFACTS == 'true'
|
||||||
run: |
|
run: |
|
||||||
mv app/build/outputs/apk/full/debug/app-full-debug.apk skyline-$GITHUB_RUN_NUMBER-debug.apk
|
mv app/build/outputs/apk/full/debug/app-full-debug.apk skyline-$GITHUB_RUN_NUMBER-debug.apk
|
||||||
mv app/build/outputs/apk/full/release/app-full-release.apk skyline-$GITHUB_RUN_NUMBER-release.apk
|
mv app/build/outputs/apk/full/release/app-full-release.apk skyline-$GITHUB_RUN_NUMBER-release.apk
|
||||||
|
|
||||||
- name: Upload Signed Debug APK
|
- name: Upload Signed Debug APK
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
if: env.IS_SKYLINE_SIGNED == 'true' && env.UPLOAD_ARTIFACTS == 'true'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: skyline-${{ github.run_number }}-debug.apk
|
name: skyline-${{ github.run_number }}-debug.apk
|
||||||
path: skyline-${{ github.run_number }}-debug.apk
|
path: skyline-${{ github.run_number }}-debug.apk
|
||||||
|
|
||||||
- name: Upload Signed Release APK
|
- name: Upload Signed Release APK
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
if: env.IS_SKYLINE_SIGNED == 'true' && env.UPLOAD_ARTIFACTS == 'true'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: skyline-${{ github.run_number }}-release.apk
|
name: skyline-${{ github.run_number }}-release.apk
|
||||||
path: skyline-${{ github.run_number }}-release.apk
|
path: skyline-${{ github.run_number }}-release.apk
|
||||||
|
|
||||||
- name: Rename APKs (Unsigned)
|
- name: Rename APKs (Unsigned)
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'false' }}
|
if: env.IS_SKYLINE_SIGNED == 'false' && env.UPLOAD_ARTIFACTS == 'true'
|
||||||
run: |
|
run: |
|
||||||
mv app/build/outputs/apk/full/debug/app-full-debug.apk skyline-$GITHUB_RUN_NUMBER-unsigned-debug.apk
|
mv app/build/outputs/apk/full/debug/app-full-debug.apk skyline-$GITHUB_RUN_NUMBER-unsigned-debug.apk
|
||||||
mv app/build/outputs/apk/full/release/app-full-release.apk skyline-$GITHUB_RUN_NUMBER-unsigned-release.apk
|
mv app/build/outputs/apk/full/release/app-full-release.apk skyline-$GITHUB_RUN_NUMBER-unsigned-release.apk
|
||||||
|
|
||||||
- name: Upload Unsigned Debug APK
|
- name: Upload Unsigned Debug APK
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'false' }}
|
if: env.IS_SKYLINE_SIGNED == 'false' && env.UPLOAD_ARTIFACTS == 'true'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: skyline-${{ github.run_number }}-unsigned-debug.apk
|
name: skyline-${{ github.run_number }}-unsigned-debug.apk
|
||||||
path: skyline-${{ github.run_number }}-unsigned-debug.apk
|
path: skyline-${{ github.run_number }}-unsigned-debug.apk
|
||||||
|
|
||||||
- name: Upload Unsigned Release APK
|
- name: Upload Unsigned Release APK
|
||||||
if: ${{ env.IS_SKYLINE_SIGNED == 'false' }}
|
if: env.IS_SKYLINE_SIGNED == 'false' && env.UPLOAD_ARTIFACTS == 'true'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: skyline-${{ github.run_number }}-unsigned-release.apk
|
name: skyline-${{ github.run_number }}-unsigned-release.apk
|
||||||
|
Loading…
Reference in New Issue
Block a user