-
Notifications
You must be signed in to change notification settings - Fork 2
148 lines (121 loc) · 4.04 KB
/
main.yml
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
139
140
141
142
143
144
145
146
147
148
name: tarball
on:
push:
pull_request:
workflow_dispatch:
inputs:
version:
description: Which Chromium version to build
required: true
type: string
env:
VERSION: ${{ inputs.version && inputs.version || (startsWith(github.ref, 'refs/tags/') && github.ref_name || '124.0.6315.2') }}
REMOTE: ${{ (startsWith(github.ref, 'refs/tags/121') || startsWith(github.ref, 'refs/tags/120')) && 'goma' || 'reclient' }}
jobs:
build:
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- name: Mount workspace to /mnt
if: runner.os == 'Linux'
run: |
sudo mkdir /mnt/work
sudo mount --bind /mnt/work ${{ github.workspace }}
sudo chown runner:runner ${{ github.workspace }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout Chromium
run: ./checkout.py --revision $VERSION
- name: Create source tarball
run: |
./export_tarball.py chromium-$VERSION --progress
ls -lh *.tar.xz
- name: Upload Binary Files
uses: actions/upload-artifact@v3
with:
path: '*.tar.xz'
retention-days: 1
test:
if: inputs.version
needs: [build]
runs-on: ${{ fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.targetOs] }}
strategy:
fail-fast: false
matrix:
targetOs: [linux, mac, win]
targetCpu: [x64, arm64]
steps:
- name: Mount workspace to /mnt
if: runner.os == 'Linux'
run: |
sudo mkdir /mnt/work
sudo mount --bind /mnt/work ${{ github.workspace }}
sudo chown runner:runner ${{ github.workspace }}
- name: Checkout
uses: actions/checkout@v3
with:
repository: photoionization/build_chromium
submodules: recursive
- uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install python dependencies
run: python -m pip install pyyaml httplib2
- name: Use XCode 15
if: runner.os == 'macOS'
run: |
XCODE_APP=$(find /Applications -maxdepth 1 -type d -name "Xcode_15.*" -print -quit)
echo 'Using' $XCODE_APP
sudo xcode-select --switch $XCODE_APP
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install gperf
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- name: Download Files
uses: actions/download-artifact@v3
- name: Checkout Chromium
shell: bash
run: python3 bootstrap.py --tarball-url 'file:///${{ github.workspace }}'"/artifact/chromium-$VERSION.tar.xz" --target-cpu ${{ matrix.targetCpu }}
- name: Setup Reclient
if: env.REMOTE == 'reclient'
env:
ELECTRON_RBE_JWT: ${{ secrets.RBE_SECRET }}
run: node reclient.js login
- name: Setup GOMA
if: env.REMOTE == 'goma'
shell: bash
env:
SECRET_FILE_CONTENT: ${{ secrets.GOMA_OAUTH2_CONFIG }}
run: |
printf "$SECRET_FILE_CONTENT" > ~/.goma_oauth2_config
node goma.js
- name: Build Chromium
run: |
python3 gn_gen.py --${{ env.REMOTE }} --target-cpu ${{ matrix.targetCpu }}
python3 build.py
release:
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: python -m pip install feedparser
- name: Find release notes
run: ./find_release_notes.py $VERSION > body.html
- name: Download Files
uses: actions/download-artifact@v3
- name: Release
uses: ncipollo/release-action@v1
with:
name: Chromium ${{ github.ref_name }}
bodyFile: body.html
artifacts: artifact/*.tar.xz
artifactErrorsFailBuild: true