From 317e207948ae2b536e39fdb97097eece0347c238 Mon Sep 17 00:00:00 2001 From: SSimco <37044560+SSimco@users.noreply.github.com> Date: Sun, 22 Sep 2024 00:00:28 +0300 Subject: [PATCH] Updated release workflow --- .github/workflows/android_build.yml | 1 + .github/workflows/deploy_release_android.yml | 46 ++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/deploy_release_android.yml diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index e6911d3d8..401aa6e29 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -1,6 +1,7 @@ name: Android build on: + workflow_call: workflow_dispatch: push: branches: ["android"] diff --git a/.github/workflows/deploy_release_android.yml b/.github/workflows/deploy_release_android.yml new file mode 100644 index 000000000..2e63da56d --- /dev/null +++ b/.github/workflows/deploy_release_android.yml @@ -0,0 +1,46 @@ +name: Deploy experimental android release +on: + workflow_dispatch: + + +jobs: + call-release-build: + uses: ./.github/workflows/android_build.yml + secrets: inherit + deploy: + name: Deploy experimental release + runs-on: ubuntu-22.04 + needs: [call-release-build] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v4 + with: + name: cemu-android + path: cemu-android + + - name: Initialize + run: | + mkdir upload + sudo apt install zip + + - name: Set version dependent vars + run: | + echo "CEMU_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + + - name: Create release from apk + run: | + VERSION=${{ env.CEMU_VERSION }} + echo "Cemu Version is $VERSION" + ls cemu-android + mv cemu-android/*.apk upload/Cemu-$VERSION.apk + + - name: Create release + run: | + 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\n%s" "Latest commit ${{ 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