Skip to content

Split Release and PR Github Workflow #1

Split Release and PR Github Workflow

Split Release and PR Github Workflow #1

Workflow file for this run

name: PR Build
on:
pull_request:
paths-ignore:
- '.idea/**'
- '.github/ISSUE_TEMPLATE/**'
- '.gitattributes'
- '.gitignore'
- '*.md'
- 'LICENSE'
- 'custom-game-area/**'
- 'wiki/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
JAVA_VERSION: 17
JAVA_DISTRO: 'temurin'
VERSION_CODE: '${{ github.run_number }}'
jobs:
build:
runs-on: macos-14
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: 'gradle'
- name: Determine Version Name
shell: bash
run: |
VERSION_NAME=$VERSION_CODE
echo "FGA_VERSION_CODE=$VERSION_CODE" >>${GITHUB_ENV}
echo "FGA_VERSION_NAME=$VERSION_NAME" >>${GITHUB_ENV}
- name: Build Android Package
run: ./gradlew assembleCi --scan --parallel --no-daemon
- name: Rename Artifacts
run: |
mv app/build/outputs/apk/ci/app-ci.apk app/build/outputs/apk/ci/fga-pr-${{ github.run_number }}.apk
mv app/build/outputs/mapping/ci/mapping.txt app/build/outputs/apk/ci/fga-mapping-${{ github.run_number }}.txt
echo "FGA_APK_PATH=app/build/outputs/apk/ci/fga-pr-${{ github.run_number }}.apk" >>${GITHUB_ENV}
echo "FGA_MAPPING_PATH=app/build/outputs/apk/ci/fga-mapping-${{ github.run_number }}.txt" >>${GITHUB_ENV}
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: FGA-pr-${{ github.run_number }}
path: ${{ env.FGA_APK_PATH }}
- name: Upload De-obfuscation mapping file
uses: actions/upload-artifact@v4
with:
name: FGA-mapping-pr-${{ github.run_number }}
path: ${{ env.FGA_MAPPING_PATH }}