bromite-buildtools/.github/workflows/check_git_apply.yaml

136 lines
4.7 KiB
YAML
Raw Normal View History

2022-10-28 14:38:14 +05:30
name: Check git apply
on:
workflow_dispatch:
inputs:
rtag:
description: 'uazo/bromite TAG or COMMIT'
required: true
default: ''
2022-10-28 21:05:12 +05:30
branch:
description: 'uazo/bromite BRANCH'
required: true
default: ''
2022-10-28 14:38:14 +05:30
env:
2022-10-28 17:42:07 +05:30
GITHUB_SHA: ${{ github.event.inputs.rtag }}
2022-10-28 21:18:37 +05:30
USEINTERNALNETWORK: false # CUSTOM RUNNER: create the docker network as internal
REMOVEDOCKERSUPPORT: false # CUSTOM RUNNER: remove sharing of docker socket
2022-10-28 21:26:57 +05:30
https_proxy: http://172.18.0.1:8118
http_proxy: http://172.18.0.1:8118
2022-10-28 14:38:14 +05:30
jobs:
2022-10-28 15:03:06 +05:30
get-git-apply:
2022-10-28 14:38:14 +05:30
runs-on: ci
2022-10-28 21:12:19 +05:30
container:
image: uazo/build-deps:latest
env:
GITHUB_SHA: ${{ github.event.inputs.rtag }}
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
2022-10-28 21:18:37 +05:30
REMOVEDOCKERSUPPORT: false # CUSTOM RUNNER: remove sharing of docker socket
2022-10-28 21:12:19 +05:30
volumes:
- /tmp/proxy:/tmp/proxy
2022-10-28 14:38:14 +05:30
steps:
- name: Prepare container
2022-10-28 15:45:11 +05:30
run: |
2022-10-28 21:12:19 +05:30
sudo chown lg /etc/apt/apt.conf.d/proxy.conf
sudo chown lg .
sudo echo Acquire::http::Proxy \"http://172.18.0.1:8118\"\; >/etc/apt/apt.conf.d/proxy.conf
2022-10-28 21:24:09 +05:30
#export HTTPS_PROXY=http://172.18.0.1:8118
#export HTTP_PROXY=http://172.18.0.1:8118
#export http_proxy=http://172.18.0.1:8118
#export https_proxy=http://172.18.0.1:8118
2022-10-28 21:18:37 +05:30
sudo chown lg /__w/_temp
2022-10-28 15:45:11 +05:30
2022-10-28 17:47:49 +05:30
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
2022-10-28 17:48:46 +05:30
sudo apt update
2022-10-28 17:47:49 +05:30
sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl nano aspnetcore-runtime-6.0
2022-10-28 14:38:14 +05:30
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
2022-10-28 21:14:24 +05:30
#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/bromite/branch_commits/$GITHUB_SHA | ./pup -p li.branch:last-child a text{})
2022-10-28 14:38:14 +05:30
2022-10-28 17:20:38 +05:30
test -d /github/home/.vscode-server || sudo mkdir /github/home/.vscode-server
sudo chown lg /github/home/.vscode-server
2022-10-28 17:17:37 +05:30
2022-10-28 21:05:12 +05:30
- name: Checkout 'uazo/bromite'
2022-10-28 14:38:14 +05:30
uses: actions/checkout@v2
with:
repository: 'uazo/bromite'
ref: ${{ github.event.inputs.rtag }}
path: 'bromite'
fetch-depth: 1
2022-10-28 21:05:12 +05:30
- name: Download chromium sources
2022-10-28 14:38:14 +05:30
run: |
VERSION=$(cat bromite/build/RELEASE)
./bin/SuperPatchUtils bromite $GITHUB_SHA chromium/src
cd chromium/src
git init
git config user.email "you@example.com"
git config user.name "Your Name"
git add .
git commit -m $VERSION
git tag -a $VERSION -m $VERSION
cd ../..
- name: Apply patches ${{ github.event.inputs.rtag }}
run: |
export HOME=$(pwd)
cd ~/chromium/src
export SILENT=true
export CGA_REMOTE=true
export SKIPAUTOGENERATED=true
bash ~/bromite-buildtools/apply-all-patch.sh || sleep 23h
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
rm -rf build/patches/*
mv build/patches-new/* build/patches
rm -rf build/patches-new/
- name: Check differences CHANGES=${{ env.CHANGES }}
run: |
cd bromite
CHANGES=0 && git diff --quiet || CHANGES=1
if [[ CHANGES -eq 1 ]]; then
git add build/patches/*.patch
git diff --name-only --staged
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@dcd5fd746d53dd8de555c0f10bca6c35628be47a #v3.12.0
with:
path: bromite
2022-10-28 21:05:12 +05:30
base: ${{ github.event.inputs.branch }}
2022-10-28 14:38:14 +05:30
add-paths: |
build/patches/*.patch
commit-message: 'AUTOMATED - git apply results'
2022-10-28 21:05:12 +05:30
title: Git apply result for ${{ github.event.inputs.branch }} branch
2022-10-28 14:38:14 +05:30
body: ${{ env.MESSAGE }}
delete-branch: true
branch-suffix: short-commit-hash