Deploy experimental android release #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy experimental android release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version_major: | |
| description: Version major | |
| required: false | |
| type: string | |
| version_minor: | |
| description: Version minor | |
| required: false | |
| type: string | |
| env: | |
| VCPKG_ROOT: "${{github.workspace}}/dependencies/vcpkg" | |
| VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" | |
| VCPKG_FORCE_DOWNLOADED_BINARIES: true | |
| jobs: | |
| deploy: | |
| name: Deploy experimental release | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: "recursive" | |
| fetch-depth: 0 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt update -qq | |
| sudo apt install -y gettext mono-complete | |
| - name: Uncompile message catalogs | |
| run: | | |
| for mo_file in bin/resources/*/cemu.mo | |
| do | |
| echo $mo_file | |
| language_code=$(basename $(dirname $mo_file)) | |
| po_file=src/android/app/src/main/assets/translations/$language_code/cemu.po | |
| mkdir -p $(dirname $po_file) | |
| msgunfmt $mo_file -o $po_file || echo "Failed to uncompile message catalog from $mo_file" | |
| done | |
| - name: Setup vcpkg binary cache | |
| uses: ./.github/actions/set-up-vcpkg-binary-cache-action | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Build Cemu | |
| env: | |
| ANDROID_STORE_FILE_BASE64: ${{ secrets.ANDROID_STORE_FILE_BASE64 }} | |
| ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| EMULATOR_VERSION_MAJOR: ${{ inputs.version_major }} | |
| EMULATOR_VERSION_MINOR: ${{ inputs.version_minor }} | |
| run: | | |
| export JAVA_HOME=$JAVA_HOME_21_X64 | |
| cd ./src/android | |
| if [[ -n "$ANDROID_STORE_FILE_BASE64" ]]; then | |
| base64 --decode <<< "${ANDROID_STORE_FILE_BASE64}" > store.jks | |
| export ANDROID_STORE_FILE=$(pwd)/store.jks | |
| echo "Android signing store file has been set up." | |
| else | |
| echo "No Android signing store file provided. The APK will not be signed with a release key." | |
| fi | |
| ./gradlew assembleRelease | |
| - name: Set version dependent vars | |
| env: | |
| EMULATOR_VERSION_MAJOR: ${{ inputs.version_major }} | |
| EMULATOR_VERSION_MINOR: ${{ inputs.version_minor }} | |
| run: | | |
| echo "CEMU_VERSION=$EMULATOR_VERSION_MAJOR.$EMULATOR_VERSION_MINOR" >> $GITHUB_ENV | |
| - name: Create release | |
| run: | | |
| VERSION=${{ env.CEMU_VERSION }} | |
| mkdir upload | |
| mv ./src/android/app/build/outputs/apk/*/*.apk upload/Cemu-$VERSION.apk | |
| wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz | |
| tar xvzf ghr.tar.gz; rm ghr.tar.gz | |
| echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}" | |
| RELEASE_BODY=$(printf "Experimental release %s" "${{ env.CEMU_VERSION }}") | |
| ghr_v0.15.0_linux_amd64/ghr -b "$RELEASE_BODY" -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }}" "${{ env.CEMU_VERSION }}" ./upload |