Skip to content

Release Cromite CI

Release Cromite CI #17

Workflow file for this run

name: Release Cromite CI
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:
BROMITE_SHA: ${{ github.event.inputs.sha }}
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
jobs:
release:
runs-on: ${{ github.event.inputs.type }}
env:
OUTPUTFILE_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/arm64/
OUTPUTFILE_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/x64/
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- 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/$BROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs)
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
wget https://github.com/cli/cli/releases/download/v2.18.1/gh_2.18.1_linux_amd64.tar.gz
tar xfz gh_2.18.1_linux_amd64.tar.gz
- name: Checkout 'uazo/cromite'
uses: actions/checkout@v2
with:
repository: 'uazo/cromite'
path: 'cromite'
fetch-depth: 1
- name: Create release
shell: bash
run: |
WINOUT=/storage/images/$BROMITE_SHA/win/x64/
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
echo "\`\`\`" >note
# echo "this is not the official release of bromite but a test version." >>note
# echo "you can try it at your own risk." >>note
echo "\`\`\`" >>note
$GH release create $VERSION-$BROMITE_SHA --notes-file note -d
# android arm64
echo "::group::-------- android arm64"
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk arm64_ChromePublic.apk
sudo chown runner arm64_ChromePublic.apk
echo Uploading arm64_ChromePublic
$GH release upload $VERSION-$BROMITE_SHA arm64_ChromePublic.apk
echo "::endgroup::"
# android x64
echo "::group::-------- android x64"
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk x64_ChromePublic.apk
sudo chown runner x64_ChromePublic.apk
echo Uploading x64_ChromePublic
$GH release upload $VERSION-$BROMITE_SHA x64_ChromePublic.apk
echo "::endgroup::"
echo "::group::-------- chrome.size"
test $VERSION-$BROMITE_SHA $OUTPUTFILE_ARM64/chrome.size && \
$GH release upload $VERSION-$BROMITE_SHA $OUTPUTFILE_ARM64/chrome.size
echo "::endgroup::"
echo "::group::-------- ChromePublic.apk.mapping"
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk.mapping arm64_ChromePublic.apk.mapping
$GH release upload $VERSION-$BROMITE_SHA arm64_ChromePublic.apk.mapping
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk.mapping x64_ChromePublic.apk.mapping
$GH release upload $VERSION-$BROMITE_SHA x64_ChromePublic.apk.mapping
echo "::endgroup::"
echo "::group::-------- Uploading arm64_ninja_log_trace.html"
test $OUTPUTFILE_ARM64/ninja_log_trace.html && \
cp $OUTPUTFILE_ARM64/ninja_log_trace.html arm64_ninja_log_trace.html && \
$GH release upload $VERSION-$BROMITE_SHA arm64_ninja_log_trace.html
echo "::endgroup::"
echo "::group::-------- windows"
mkdir chrome-win/
cp $WINOUT/*.manifest chrome-win/
cp $WINOUT/chrome.dll chrome-win/
cp $WINOUT/chrome.exe chrome-win/
cp $WINOUT/chrome_100_percent.pak chrome-win/
cp $WINOUT/chrome_200_percent.pak chrome-win/
cp $WINOUT/chrome_elf.dll chrome-win/
cp $WINOUT/chrome_proxy.exe chrome-win/
cp $WINOUT/chrome_pwa_launcher.exe chrome-win/
cp $WINOUT/chrome_wer.dll chrome-win/
cp "/win_sdk/10.0.22621.0/Windows Kits/10/Redist/D3D/x64/d3dcompiler_47.dll" chrome-win/
cp $WINOUT/elevation_service.exe chrome-win/
cp "$WINOUT/First Run" chrome-win/
cp $WINOUT/headless_lib_data.pak chrome-win/
cp $WINOUT/icudtl.dat chrome-win/
cp $WINOUT/libEGL.dll chrome-win/
cp $WINOUT/libGLESv2.dll chrome-win/
cp $WINOUT/Logo.png chrome-win/
cp $WINOUT/mojo_core.dll chrome-win/
cp $WINOUT/notification_helper.exe chrome-win/
cp $WINOUT/resources.pak chrome-win/
cp $WINOUT/SmallLogo.png chrome-win/
cp $WINOUT/snapshot_blob.bin chrome-win/
cp $WINOUT/VkICD_mock_icd.dll chrome-win/
cp $WINOUT/VkLayer_khronos_validation.dll chrome-win/
cp $WINOUT/vk_swiftshader.dll chrome-win/
cp $WINOUT/vulkan-1.dll chrome-win/
cp -r $WINOUT/locales chrome-win/locales
#test chrome-win.zip && rm chrome-win.zip
zip -r chrome-win.zip chrome-win/
echo Uploading chrome-win.zip
$GH release upload $VERSION-$BROMITE_SHA chrome-win.zip
echo "::endgroup::"
echo "::group::-------- arm64 symbols"
zip arm64_symbols.zip ${{ env.OUTPUTFILE_ARM64 }}/dump_syms \
${{ env.OUTPUTFILE_ARM64 }}/minidump_stackwalk \
${{ env.OUTPUTFILE_ARM64 }}/libchrome.so
$GH release upload $VERSION-$BROMITE_SHA arm64_symbols.zip
echo "::endgroup::"
# workaround for https://github.com/cli/cli/issues/6599
sleep 30s
TIMESTAMP=$(date +%s -r chrome-win.zip)
echo >updateurl.txt "browser=chromium;os=windows;architecture=64-bit;timestamp=$TIMESTAMP;editor=uazo;channel=stable;repository=https://github.com/uazo/cromite/releases;download=https://github.com/uazo/cromite/releases/latest/download/chrome-win.zip;version=$(cat $WINOUT/RELEASE);revision=1;commit=$BROMITE_SHA"
$GH release upload $VERSION-$BROMITE_SHA updateurl.txt
$GH release edit $VERSION-$BROMITE_SHA -t $VERSION-$BROMITE_SHA
$GH release edit $VERSION-$BROMITE_SHA --draft=false
VERSION=$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE)
docker push uazo/cromite:$VERSION-$BROMITE_SHA
docker push uazo/cromite-build:$VERSION-$BROMITE_SHA