Skip to content

Merge pull request #52 from schnatterer/renovate/chenxiaolong-avbroot… #51

Merge pull request #52 from schnatterer/renovate/chenxiaolong-avbroot…

Merge pull request #52 from schnatterer/renovate/chenxiaolong-avbroot… #51

name: Release single device
on:
# Note that push/PR will not release, only build to see if there are obvious failures
push:
branches:
- '*'
pull_request:
types: [synchronize, opened, reopened]
workflow_call:
inputs:
device-id:
type: string
magisk-preinit-device:
type: string
default: ''
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
device-id:
description: Device ID
required: true
magisk-preinit-device:
description: Magisk preinit device
required: false
skip-rootless:
description: skip building rootless OTA
type: boolean
required: false
upload-test-ota:
description: Upload OTA to test folder
required: false
type: boolean
force-ota-server-upload:
description: Force OTA server upload
required: false
type: boolean
skip-ota-server-upload:
description: Skip OTA server upload
required: false
type: boolean
skip-release:
description: Skip release (build only)
required: false
type: boolean
ota-version:
description: OTA version
required: false
magisk-version:
description: Magisk version
required: false
jobs:
build-device:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Allow for switching to github-pages branch
fetch-depth: 0
- name: Set inputs
# Empty means, use version defined in rooted-ota.sh
# Note the difference between github.event.inputs (workflow_dispatch) and inputs (workflow_call)
run: |
echo "DEVICE_ID=$(echo '${{ github.event.inputs.device-id || inputs.device-id || 'shiba' }}' | xargs)" >> $GITHUB_ENV
echo "MAGISK_PREINIT_DEVICE=$(echo '${{ github.event.inputs.magisk-preinit-device || inputs.magisk-preinit-device || 'sda10' }}' | xargs)" >> $GITHUB_ENV
echo "MAGISK_VERSION=$(echo '${{ github.event.inputs.magisk-version || '' }}' | xargs)" >> $GITHUB_ENV
echo "OTA_VERSION=$(echo '${{ github.event.inputs.ota-version || '' }}' | xargs)" >> $GITHUB_ENV
echo "FORCE_OTA_SERVER_UPLOAD=$(echo '${{ github.event.inputs.force-ota-server-upload || '' }}' | xargs)" >> $GITHUB_ENV
echo "SKIP_OTA_SERVER_UPLOAD=$(echo '${{ github.event.inputs.skip-ota-server-upload || '' }}' | xargs)" >> $GITHUB_ENV
echo "UPLOAD_TEST_OTA=$(echo '${{ github.event.inputs.upload-test-ota || '' }}' | xargs)" >> $GITHUB_ENV
echo "SKIP_ROOTLESS=$(echo '${{ github.event.inputs.skip-rootless || '' }}' | xargs)" >> $GITHUB_ENV
echo "SKIP_RELEASE=$(echo '${{ github.event.inputs.skip-release || '' }}' | xargs)" >> $GITHUB_ENV
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "Running on push: Simple build without release for device $DEVICE_ID"
echo "SKIP_RELEASE=true" >> $GITHUB_ENV
fi
- run: sudo apt-get install -y jq curl git
- name: release
env:
PASSPHRASE_AVB: ${{ secrets.PASSPHRASE_AVB }}
PASSPHRASE_OTA: ${{ secrets.PASSPHRASE_OTA }}
KEY_AVB_BASE64: ${{ secrets.KEY_AVB_BASE64 }}
CERT_OTA_BASE64: ${{ secrets.CERT_OTA_BASE64 }}
KEY_OTA_BASE64: ${{ secrets.KEY_OTA_BASE64 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
run: |
if [[ $SKIP_RELEASE == 'true' ]]; then
DEBUG=1 bash -c '. rooted-ota.sh && createRootedOta && createOtaServerData'
else
DEBUG=1 bash -c '. rooted-ota.sh && createAndReleaseRootedOta'
fi