Skip to content

Mobile + Release

Mobile + Release #109

name: Mobile + Release
on: workflow_dispatch
permissions:
contents: write
discussions: write
env:
PROJECT_NAME: PsychEngine
REPO_PATH: MobilePorting/FNF-PsychEngine-Mobile
jobs:
get-commit-hash:
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.get_commit_hash.outputs.COMMIT_HASH }}
steps:
- name: Check Repository
run: |
echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY"
echo "REPO_PATH: ${{ env.REPO_PATH }}"
if [[ "$GITHUB_REPOSITORY" != "${{ env.REPO_PATH }}" ]]; then
echo "Doesn't seem to be correct, returning SIGABRT..."
exit 6
else
echo "Seems to be correct..."
fi
- name: Get latest commit hash
id: get_commit_hash
run: |
commit_hash=${GITHUB_SHA::7}
echo "Latest commit hash is $commit_hash"
echo "::set-output name=COMMIT_HASH::$commit_hash"
build:
name: ${{ matrix.name }}
needs: get-commit-hash
strategy:
matrix:
include:
- name: Android
os: macos-15
buildArgs: "android -final -D officialBuild"
artifactName: androidBuild
artifactPath: "export/release/android/bin/app/build/outputs/apk/release/*.apk"
- name: iOS
os: macos-15
buildArgs: "ios -final -nosign -D officialBuild"
artifactName: iOSBuild
artifactPath: "export/release/ios/build/Release-iphoneos/*.ipa"
uses: ./.github/workflows/build.yml
with:
name: ${{ matrix.name }}
os: ${{ matrix.os }}
buildArgs: ${{ matrix.buildArgs }}
artifactName: ${{ matrix.artifactName }}
artifactPath: ${{ matrix.artifactPath }}
Releaser:
needs: [get-commit-hash, build]
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Download Android Build
uses: actions/download-artifact@main
with:
name: androidBuild
path: /home/runner
- name: Move Android File
run: mv /home/runner/${{ env.PROJECT_NAME }}-release.apk /home/runner/${{ env.PROJECT_NAME }}-Android.apk
- name: Download iOS Build
uses: actions/download-artifact@main
with:
name: iOSBuild
path: ${{ github.workspace }}
- name: Zip iOS Build For Release
run: zip -r /home/runner/${{ env.PROJECT_NAME }}-iOS.zip ${{ github.workspace }}/${{ env.PROJECT_NAME }}.ipa
- name: Publish The Release
uses: softprops/action-gh-release@master
with:
name: "DevBuild ${{ needs.get-commit-hash.outputs.commit_hash }}"
tag_name: "devbuild-${{ needs.get-commit-hash.outputs.commit_hash }}"
prerelease: true
files: |
/home/runner/*.apk
/home/runner/*.zip