FoldCraftLauncher/.github/workflows/main.yml

85 lines
2.0 KiB
YAML
Raw Normal View History

2024-01-07 10:10:44 +00:00
name: Android CI
on:
pull_request:
branches-ignore:
- ''
push:
2024-01-16 10:02:33 +00:00
tags:
2024-02-07 13:03:44 +00:00
- '*'
2024-01-07 10:10:44 +00:00
branches-ignore:
- ''
workflow_dispatch:
jobs:
2024-02-03 07:55:36 +00:00
FCLTeamBuild:
2024-02-13 11:36:48 +00:00
if: github.repository_owner == 'FCL-Team' && !startsWith(github.ref, 'refs/pull/')
2024-01-16 05:53:43 +00:00
strategy:
matrix:
arch: [ "all", "arm", "arm64", "x86", "x64" ]
fail-fast: false
2024-01-14 01:22:55 +00:00
env:
FCL_KEYSTORE_PASSWORD: ${{ secrets.FCL_KEYSTORE_PASSWORD }}
2024-02-07 12:01:20 +00:00
CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }}
OAUTH_API_KEY: ${{ secrets.OAUTH_API_KEY }}
2024-01-16 05:53:43 +00:00
name: Build for ${{matrix.arch}}
2024-01-07 10:10:44 +00:00
runs-on: ubuntu-20.04
steps:
2024-02-03 08:30:35 +00:00
- uses: actions/checkout@v4
2024-01-16 05:53:43 +00:00
with:
fetch-depth: 0
2024-01-07 10:10:44 +00:00
2024-01-16 05:53:43 +00:00
- name: set up JDK 17
2024-02-03 08:30:35 +00:00
uses: actions/setup-java@v4
2024-01-16 05:53:43 +00:00
with:
2024-02-03 08:30:35 +00:00
distribution: 'temurin'
2024-01-16 05:53:43 +00:00
java-version: 17
2024-01-07 10:10:44 +00:00
2024-01-16 10:02:33 +00:00
- name: Build ${{matrix.arch}} .apk
2024-01-16 05:53:43 +00:00
run: |
chmod +x gradlew
2024-01-16 10:02:33 +00:00
./gradlew assemblerelease -Darch=${{matrix.arch}}
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.TOKEN }}"
files: |
FCL/build/outputs/apk/release/*.apk
2024-01-16 05:53:43 +00:00
2024-02-03 07:55:36 +00:00
- name: Upload apk
2024-01-16 10:02:33 +00:00
if: startsWith(github.ref, 'refs/heads/')
2024-02-03 08:30:35 +00:00
uses: actions/upload-artifact@v4
2024-01-16 05:53:43 +00:00
with:
2024-01-16 10:02:33 +00:00
name: app-${{matrix.arch}}
path: FCL/build/outputs/apk/release/*
2024-01-16 05:53:43 +00:00
# retention-days: 1
2024-02-03 07:55:36 +00:00
#only for fork
DebugBuild:
if: github.repository_owner != 'FCL-Team'
name: Build Debug
runs-on: ubuntu-20.04
steps:
2024-02-03 08:30:35 +00:00
- uses: actions/checkout@v4
2024-02-03 07:55:36 +00:00
with:
fetch-depth: 0
- name: set up JDK 17
2024-02-03 08:30:35 +00:00
uses: actions/setup-java@v4
2024-02-03 07:55:36 +00:00
with:
2024-02-03 08:30:35 +00:00
distribution: 'temurin'
2024-02-03 07:55:36 +00:00
java-version: 17
- name: Build debug apk
run: |
chmod +x gradlew
./gradlew assemblefordebug -Darch=all
- name: Upload debug apk
2024-02-03 08:30:35 +00:00
uses: actions/upload-artifact@v4
2024-02-03 07:55:36 +00:00
with:
name: app-debug-all
2024-02-03 08:30:35 +00:00
path: FCL/build/outputs/apk/fordebug/*