From f21c63b46e68ce3be6d23fe1056b99f71f3da2b9 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Sun, 15 Sep 2024 09:34:28 +0200 Subject: [PATCH] [TOOLS] Add release additional targets actions (#1271 #159) --- .../workflows/release_additional_targets.yaml | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/workflows/release_additional_targets.yaml diff --git a/.github/workflows/release_additional_targets.yaml b/.github/workflows/release_additional_targets.yaml new file mode 100644 index 000000000..b6605342c --- /dev/null +++ b/.github/workflows/release_additional_targets.yaml @@ -0,0 +1,112 @@ +name: Release Additional Targets +permissions: + contents: write + +on: + workflow_dispatch: + inputs: + sha: + description: 'uazo/cromite SHA' + required: true + default: '' + type: + description: 'runner? [dev/ci]' + required: true + default: 'ci' + +env: + CROMITE_SHA: ${{ github.event.inputs.sha }} + REMOVEDOCKERSUPPORT: true + USELOCALIMAGE: true + +jobs: + release: + runs-on: ${{ github.event.inputs.type }} + env: + IS_DRAFT: ${{ github.event.inputs.draft }} + OUTPUTFILE_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/arm64_webview/ + OUTPUTFILE_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/x64_webview/ + OUTPUTFILE_CHR_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/chr_arm64/ + OUTPUTFILE_CHR_ARM: /storage/images/${{ github.event.inputs.sha }}/android/false/chr_arm/ + OUTPUTFILE_CHR_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/chr_x64/ + + steps: + - name: Prepare container + run: | + wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip + unzip pup_v0.4.0_linux_amd64.zip && rm pup_v0.4.0_linux_amd64.zip + BRANCH=$(curl https://github.com/uazo/cromite/branch_commits/$CROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs) + echo "BRANCH=$BRANCH" >> $GITHUB_ENV + + - name: Checkout 'uazo/cromite' + uses: actions/checkout@v2 + with: + repository: 'uazo/cromite' + path: 'cromite' + fetch-depth: 1 + + - name: Create release + shell: bash + run: | + VERSION=v$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE) + + cd cromite/tools + + GH=gh_2.21.1_linux_amd64/bin/gh + wget https://github.com/cli/cli/releases/download/v2.21.1/gh_2.21.1_linux_amd64.tar.gz + tar xfz gh_2.21.1_linux_amd64.tar.gz + + echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token + + # android arm64 + echo "::group::-------- android systemwebview arm64" + sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/SystemWebView64.apk arm64_SystemWebView64.apk + sudo chown runner arm64_SystemWebView64.apk + + sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/SystemWebViewShell.apk arm64_SystemWebViewShell.apk + sudo chown runner arm64_SystemWebViewShell.apk + + echo Uploading arm64_SystemWebView64 + $GH release upload $VERSION-$CROMITE_SHA arm64_SystemWebView64.apk + $GH release upload $VERSION-$CROMITE_SHA arm64_SystemWebViewShell.apk + echo "::endgroup::" + + # android x64 + echo "::group::-------- android systemwebview x64" + sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/SystemWebView64.apk x64_SystemWebView64.apk + sudo chown runner x64_SystemWebView64.apk + + sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/SystemWebViewShell.apk x64_SystemWebViewShell.apk + sudo chown runner x64_SystemWebViewShell.apk + + echo Uploading x64_SystemWebView64 + $GH release upload $VERSION-$CROMITE_SHA x64_SystemWebView64.apk + $GH release upload $VERSION-$CROMITE_SHA x64_SystemWebViewShell.apk + echo "::endgroup::" + + # vanilla chromium arm + echo "::group::-------- vanilla chromium arm" + sudo cp ${{ env.OUTPUTFILE_CHR_ARM }}/apks/ChromePublic.apk arm_VanillaChromium.apk + sudo chown runner arm_VanillaChromium.apk + + echo Uploading arm_VanillaChromium + $GH release upload $VERSION-$CROMITE_SHA arm_VanillaChromium.apk + echo "::endgroup::" + + # vanilla chromium arm64 + echo "::group::-------- vanilla chromium arm64" + sudo cp ${{ env.OUTPUTFILE_CHR_ARM64 }}/apks/ChromePublic.apk arm64_VanillaChromium.apk + sudo chown runner arm64_VanillaChromium.apk + + echo Uploading arm64_VanillaChromium + $GH release upload $VERSION-$CROMITE_SHA arm64_VanillaChromium.apk + echo "::endgroup::" + + # vanilla chromium x64 + echo "::group::-------- vanilla chromium x64" + sudo cp ${{ env.OUTPUTFILE_CHR_X64 }}/apks/ChromePublic.apk x64_VanillaChromium.apk + sudo chown runner x64_VanillaChromium.apk + + echo Uploading x64_VanillaChromium + $GH release upload $VERSION-$CROMITE_SHA x64_VanillaChromium.apk + echo "::endgroup::"