forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 95
209 lines (178 loc) · 9.03 KB
/
release.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Release Cromite CI
permissions:
contents: write
on:
workflow_dispatch:
inputs:
sha:
description: 'uazo/cromite SHA'
required: true
default: ''
type:
description: 'runner? [dev/ci]'
required: true
default: 'ci'
draft:
description: 'draft? [true/false]'
required: true
default: 'false'
env:
CROMITE_SHA: ${{ github.event.inputs.sha }}
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
jobs:
release:
runs-on: ${{ github.event.inputs.type }}
env:
IS_DRAFT: ${{ github.event.inputs.draft }}
OUTPUTFILE_ARM: /storage/images/${{ github.event.inputs.sha }}/android/false/arm/
OUTPUTFILE_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/arm64/
OUTPUTFILE_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/x64/
OUTPUTFILE_WIN: /storage/images/${{ github.event.inputs.sha }}/win/x64/
OUTPUTFILE_LIN: /storage/images/${{ github.event.inputs.sha }}/linux/false/lin64/
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Prepare container
run: |
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/cromite/branch_commits/$CROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs)
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
wget https://github.com/cli/cli/releases/download/v2.18.1/gh_2.18.1_linux_amd64.tar.gz
tar xfz gh_2.18.1_linux_amd64.tar.gz
- name: Checkout 'uazo/cromite'
uses: actions/checkout@v2
with:
repository: 'uazo/cromite'
path: 'cromite'
fetch-depth: 1
- name: Create release
shell: bash
run: |
VERSION=v$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE)
cd cromite/tools
GH=gh_2.21.1_linux_amd64/bin/gh
wget https://github.com/cli/cli/releases/download/v2.21.1/gh_2.21.1_linux_amd64.tar.gz
tar xfz gh_2.21.1_linux_amd64.tar.gz
echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token
echo "\`\`\`" >note
# echo "this is not the official release of bromite but a test version." >>note
# echo "you can try it at your own risk." >>note
echo "\`\`\`" >>note
$GH release create $VERSION-$CROMITE_SHA --notes-file note -d
# android arm
echo "::group::-------- android arm"
sudo cp ${{ env.OUTPUTFILE_ARM }}/apks/ChromePublic.apk arm_ChromePublic.apk
sudo chown runner arm_ChromePublic.apk
echo Uploading arm_ChromePublic
$GH release upload $VERSION-$CROMITE_SHA arm_ChromePublic.apk
echo "::endgroup::"
# android arm64
echo "::group::-------- android arm64"
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk arm64_ChromePublic.apk
sudo chown runner arm64_ChromePublic.apk
echo Uploading arm64_ChromePublic
$GH release upload $VERSION-$CROMITE_SHA arm64_ChromePublic.apk
echo "::endgroup::"
# android x64
echo "::group::-------- android x64"
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk x64_ChromePublic.apk
sudo chown runner x64_ChromePublic.apk
echo Uploading x64_ChromePublic
$GH release upload $VERSION-$CROMITE_SHA x64_ChromePublic.apk
echo "::endgroup::"
echo "::group::-------- chrome.size"
test $VERSION-$CROMITE_SHA $OUTPUTFILE_ARM64/chrome.size && \
$GH release upload $VERSION-$CROMITE_SHA $OUTPUTFILE_ARM64/chrome.size
echo "::endgroup::"
echo "::group::-------- ChromePublic.apk.mapping"
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk.mapping arm64_ChromePublic.apk.mapping
$GH release upload $VERSION-$CROMITE_SHA arm64_ChromePublic.apk.mapping
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk.mapping x64_ChromePublic.apk.mapping
$GH release upload $VERSION-$CROMITE_SHA x64_ChromePublic.apk.mapping
echo "::endgroup::"
echo "::group::-------- Uploading arm64_ninja_log_trace.html"
test $OUTPUTFILE_ARM64/ninja_log_trace.html && \
cp $OUTPUTFILE_ARM64/ninja_log_trace.html arm64_ninja_log_trace.html && \
$GH release upload $VERSION-$CROMITE_SHA arm64_ninja_log_trace.html
echo "::endgroup::"
# windows x64
echo "::group::-------- windows x64"
mkdir chrome-win/
cp $OUTPUTFILE_WIN/*.manifest chrome-win/
cp $OUTPUTFILE_WIN/chrome.dll chrome-win/
cp $OUTPUTFILE_WIN/chrome.exe chrome-win/
cp $OUTPUTFILE_WIN/chrome_100_percent.pak chrome-win/
cp $OUTPUTFILE_WIN/chrome_200_percent.pak chrome-win/
cp $OUTPUTFILE_WIN/chrome_elf.dll chrome-win/
cp $OUTPUTFILE_WIN/chrome_proxy.exe chrome-win/
cp $OUTPUTFILE_WIN/chrome_pwa_launcher.exe chrome-win/
cp $OUTPUTFILE_WIN/chrome_wer.dll chrome-win/
cp "/win_sdk/10.0.22621.0/Windows Kits/10/Redist/D3D/x64/d3dcompiler_47.dll" chrome-win/
cp $OUTPUTFILE_WIN/elevation_service.exe chrome-win/
cp "$OUTPUTFILE_WIN/First Run" chrome-win/
cp $OUTPUTFILE_WIN/headless_lib_data.pak chrome-win/
cp $OUTPUTFILE_WIN/icudtl.dat chrome-win/
cp $OUTPUTFILE_WIN/libEGL.dll chrome-win/
cp $OUTPUTFILE_WIN/libGLESv2.dll chrome-win/
cp $OUTPUTFILE_WIN/Logo.png chrome-win/
cp $OUTPUTFILE_WIN/notification_helper.exe chrome-win/
cp $OUTPUTFILE_WIN/resources.pak chrome-win/
cp $OUTPUTFILE_WIN/SmallLogo.png chrome-win/
cp $OUTPUTFILE_WIN/snapshot_blob.bin chrome-win/
cp $OUTPUTFILE_WIN/VkICD_mock_icd.dll chrome-win/
cp $OUTPUTFILE_WIN/VkLayer_khronos_validation.dll chrome-win/
cp $OUTPUTFILE_WIN/vk_swiftshader.dll chrome-win/
cp $OUTPUTFILE_WIN/vulkan-1.dll chrome-win/
cp -r $OUTPUTFILE_WIN/locales chrome-win/locales
#test chrome-win.zip && rm chrome-win.zip
zip -r chrome-win.zip chrome-win/
echo Uploading chrome-win.zip
$GH release upload $VERSION-$CROMITE_SHA chrome-win.zip
echo "::endgroup::"
## linux
echo "::group::-------- linux x64"
mkdir chrome-lin/
cp $OUTPUTFILE_LIN/chrome chrome-lin/
cp $OUTPUTFILE_LIN/chrome_100_percent.pak chrome-lin/
cp $OUTPUTFILE_LIN/chrome_200_percent.pak chrome-lin/
cp $OUTPUTFILE_LIN/chrome_crashpad_handler chrome-lin/
cp $OUTPUTFILE_LIN/chrome-wrapper chrome-lin/
cp $OUTPUTFILE_LIN/icudtl.dat chrome-lin/
cp $OUTPUTFILE_LIN/libEGL.so chrome-lin/
cp $OUTPUTFILE_LIN/libGLESv2.so chrome-lin/
cp $OUTPUTFILE_LIN/libvulkan.so.1 chrome-lin/
cp $OUTPUTFILE_LIN/libqt5_shim.so chrome-lin/
cp $OUTPUTFILE_LIN/libqt6_shim.so chrome-lin/
cp $OUTPUTFILE_LIN/libvk_swiftshader.so chrome-lin/
cp -r $OUTPUTFILE_LIN/locales/ chrome-lin/locales
cp $OUTPUTFILE_LIN/product_logo_48.png chrome-lin/
cp $OUTPUTFILE_LIN/resources.pak chrome-lin/
cp $OUTPUTFILE_LIN/snapshot_blob.bin chrome-lin/
cp $OUTPUTFILE_LIN/xdg-mime chrome-lin/
cp $OUTPUTFILE_LIN/xdg-settings chrome-lin/
cp $OUTPUTFILE_LIN/chrome_sandbox chrome-lin/
tar -czvf chrome-lin64.tar.gz chrome-lin/
echo Uploading chrome-lin64.tar.gz
$GH release upload $VERSION-$CROMITE_SHA chrome-lin64.tar.gz
echo "::endgroup::"
echo "::group::-------- arm64 symbols"
zip arm64_symbols.zip ${{ env.OUTPUTFILE_ARM64 }}/dump_syms \
${{ env.OUTPUTFILE_ARM64 }}/minidump_stackwalk \
${{ env.OUTPUTFILE_ARM64 }}/libchrome.so
$GH release upload $VERSION-$CROMITE_SHA arm64_symbols.zip
echo "::endgroup::"
TIMESTAMP=$(date +%s -r chrome-win.zip)
echo >updateurl.txt "browser=chromium;os=windows;architecture=64-bit;timestamp=$TIMESTAMP;editor=uazo;channel=stable;repository=https://github.com/uazo/cromite/releases;download=https://github.com/uazo/cromite/releases/latest/download/chrome-win.zip;version=$(cat $OUTPUTFILE_WIN/RELEASE);revision=1;commit=$CROMITE_SHA"
$GH release upload $VERSION-$CROMITE_SHA updateurl.txt
$GH release edit $VERSION-$CROMITE_SHA -t $VERSION-$CROMITE_SHA
if [ $IS_DRAFT == "false" ]; then
$GH release edit $VERSION-$CROMITE_SHA --draft=false
fi
VERSION=$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE)
docker push uazo/cromite:$VERSION-$CROMITE_SHA
docker push uazo/cromite-build:$VERSION-$CROMITE_SHA