-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (70 loc) · 2.59 KB
/
build.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
name: build
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
python3 \
git \
curl \
gn \
npm
- name: Install Depot Tools
uses: newkdev/[email protected]
- name: Fetch devtools-frontend
run: fetch --no-history devtools-frontend
- name: Build devtools-frontend
run: |
cd devtools-frontend
gclient sync
gn gen out/Default
autoninja -C out/Default
- name: Create commit
id: create_commit
run: |
# Copy built files
rsync -a ./devtools-frontend/out/Default/gen/front_end/ ./public
# Create index.html
cp ./public/devtools_app.html ./public/index.html
# Create commit info with latest devtools-frontend commit
current_date=$(date +"%d-%m-%Y")
latest_commit_full=$(git ls-remote https://chromium.googlesource.com/devtools/devtools-frontend.git HEAD | cut -f 1)
latest_commit_short=${latest_commit_full:0:7}
commit_title="Build $current_date"
commit_description="Latest devtools frontend commit: [${latest_commit_short}](https://chromium.googlesource.com/devtools/devtools-frontend.git/+/${latest_commit_full})"
branch_name="build/${current_date}"
# Create step outputs
echo "branch_name=${branch_name}" >> $GITHUB_OUTPUT
echo "commit_title=${commit_title}" >> $GITHUB_OUTPUT
echo "commit_description=${commit_description}" >> $GITHUB_OUTPUT
- name: Create PR
id: create_pr
uses: peter-evans/create-pull-request@v5
with:
branch: ${{ steps.create_commit.outputs.branch_name }}
title: ${{ steps.create_commit.outputs.commit_title }}
body: ${{ steps.create_commit.outputs.commit_description }}
commit-message: ${{ steps.create_commit.outputs.commit_description }}
author: GitHub <[email protected]>
labels: auto-build
branch-suffix: timestamp
add-paths: |
public
- name: Merge PR
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: squash
token: ${{ secrets.PAT }}