103 lines
3.0 KiB
YAML
103 lines
3.0 KiB
YAML
name: Check git apply
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
rtag:
|
|
description: 'uazo/bromite TAG or COMMIT'
|
|
required: true
|
|
default: ''
|
|
|
|
env:
|
|
RTAG: ${{ github.event.inputs.rtag }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Prepare container
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl
|
|
|
|
wget https://github.com/uazo/superpatch/releases/latest/download/SuperPatchUtils.tar.gz
|
|
tar xfz SuperPatchUtils.tar.gz
|
|
rm SuperPatchUtils.tar.gz
|
|
|
|
git clone https://github.com/uazo/bromite-buildtools
|
|
|
|
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
|
|
|
|
- name: Download bromite sources
|
|
run: |
|
|
mkdir bromite && cd bromite
|
|
git init
|
|
git remote add origin https://github.com/uazo/bromite
|
|
git fetch origin $RTAG
|
|
git reset --hard FETCH_HEAD
|
|
cd ..
|
|
|
|
- name: Download chromium sources
|
|
run: |
|
|
./bin/SuperPatchUtils bromite $RTAG chromium/src
|
|
cd chromium/src
|
|
git init
|
|
git config user.email "you@example.com"
|
|
git config user.name "Your Name"
|
|
git add .
|
|
VERSION=$(cat ../../bromite/build/RELEASE)
|
|
git commit -m $VERSION
|
|
git tag -a $VERSION -m $VERSION
|
|
cd ../..
|
|
|
|
- name: Apply patches
|
|
run: |
|
|
export HOME=$(pwd)
|
|
cd ~/chromium/src
|
|
|
|
export SILENT=true
|
|
export SKIPAUTOGENERATED=true
|
|
bash ~/bromite-buildtools/apply-all-patch.sh || exit 1
|
|
|
|
rm -rf ~/bromite/build/patches-new/
|
|
rm ~/bromite/build/bromite_patches_list_new.txt
|
|
|
|
- name: Export patches
|
|
run: |
|
|
export HOME=$(pwd)
|
|
|
|
cd ~/chromium/src
|
|
bash ~/bromite-buildtools/export-all-patch.sh
|
|
|
|
cd ~/bromite
|
|
mv build/patches-new/* build/patches
|
|
rm -rf build/patches-new/
|
|
|
|
- name: Export patches
|
|
run: |
|
|
cd bromite
|
|
CHANGES=0 && git diff --quiet || CHANGES=1
|
|
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
|
|
|
if [[ CHANGES -eq 1 ]]; then
|
|
BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$RTAG | ../pup -p li.branch a text{})
|
|
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
|
|
|
git add .
|
|
fi
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v3.12.0
|
|
if: env.CHANGES == '1'
|
|
with:
|
|
path: bromite
|
|
branch: ${{ env.BRANCH }}
|
|
add-paths: |
|
|
build/patches/*.patch
|
|
commit-message: Check git apply result
|
|
title: Check git apply result
|
|
delete-branch: true
|
|
branch-suffix: short-commit-hash
|