-
Notifications
You must be signed in to change notification settings - Fork 9
138 lines (115 loc) · 4.83 KB
/
check_git_apply.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Check git apply
on:
workflow_dispatch:
inputs:
rtag:
description: 'uazo/bromite TAG or COMMIT'
required: true
default: ''
branch:
description: 'uazo/bromite BRANCH'
required: true
default: ''
env:
GITHUB_SHA: ${{ github.event.inputs.rtag }}
BROMITE_SHA: ${{ github.event.inputs.rtag }}
USEINTERNALNETWORK: false # CUSTOM RUNNER: create the docker network as internal
REMOVEDOCKERSUPPORT: false # CUSTOM RUNNER: remove sharing of docker socket
https_proxy: http://172.18.0.1:8118
http_proxy: http://172.18.0.1:8118
jobs:
get-git-apply:
runs-on: ci
container:
image: uazo/build-deps:latest
env:
GITHUB_SHA: ${{ github.event.inputs.rtag }}
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
REMOVEDOCKERSUPPORT: false # CUSTOM RUNNER: remove sharing of docker socket
volumes:
- /tmp/proxy:/tmp/proxy
steps:
- name: Prepare container
run: |
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
#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
sudo chmod 777 /__w/_temp
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
sudo apt update
sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl nano aspnetcore-runtime-6.0
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
#BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$GITHUB_SHA | ./pup -p li.branch:last-child a text{})
test -d /github/home/.vscode-server || sudo mkdir /github/home/.vscode-server
sudo chown lg /github/home/.vscode-server
- name: Checkout 'uazo/bromite'
uses: actions/checkout@v2
with:
repository: 'uazo/bromite'
ref: ${{ github.event.inputs.rtag }}
path: 'bromite'
fetch-depth: 1
- name: Create chromium sources
run: |
#sleep 2h
VERSION=$(cat bromite/build/RELEASE)
./bin/SuperPatchUtils bromite $BROMITE_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
- 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 || true
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:
token: ${{ secrets.BROMITE_PULLS_PAT }}
path: bromite
base: ${{ github.event.inputs.branch }}
add-paths: |
build/patches/*.patch
commit-message: 'AUTOMATED - git apply results'
title: Git apply result for ${{ github.event.inputs.branch }} branch
body: ${{ env.MESSAGE }}
delete-branch: true
branch-suffix: short-commit-hash