forked from ungoogled-software/ungoogled-chromium-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (113 loc) · 4.21 KB
/
build-images.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
name: Build container images for cross build
on:
workflow_dispatch:
inputs:
upload:
type: boolean
description: "Upload to registry"
default: false
env:
# used in cross-build/Makefile
APT_MIRROR: azure.archive.ubuntu.com
IMAGE_SOURCE: ${{github.server_url}}/${{github.repository}}
jobs:
main:
runs-on: ubuntu-24.04
permissions:
# needed to upload container images
packages: write
steps:
- name: Clone u-c-w Git repository
uses: actions/checkout@v4
- name: Clone msvc-wine Git repository
uses: actions/checkout@v4
with:
repository: mstorsjo/msvc-wine
ref: 209623ed118aac0121e63a7e86e467c238516f5a # 20240912
path: cross-build/msvc-wine
- name: Free up disk space
run: cd / && sudo $GITHUB_WORKSPACE/cross-build/gh-unburden.sh
- name: Adjust APT config
run: |
sudo tee /etc/apt/apt.conf.d/95custom << END
# Don't install recommended packages
APT::Install-Recommends "0";
# Don't use "Reading database ... X%" progress indicator
Dpkg::Use-Pty "false";
END
- name: Build base container image
run: |
cd cross-build
make build-image-base \
BUILD_UID=$(id -u) \
MULTI_ARCH=1
- name: Install packages required for extracting the MSVC files
run: sudo apt-get -y install msitools
- name: Restore MSVC download cache
id: restore-msvc
uses: actions/cache/restore@v4
with:
key: msvc-download
path: cross-build/msvc-cache
- name: Build MSVC container image
run: |
cd cross-build
make build-image \
MSVC_ACCEPT_LICENSE=--accept-license \
MULTI_ARCH=1
- name: Save MSVC download cache
if: ${{!steps.restore-msvc.outputs.cache-hit}}
uses: actions/cache/save@v4
with:
key: msvc-download
path: cross-build/msvc-cache
- name: Get date-based version tag for images
id: version
run: |
vtag=$(date '+%Y%m%d')
echo "Image version tag: $vtag"
echo "tag=$vtag" >> $GITHUB_OUTPUT
- name: Log in to GitHub Container Registry
if: inputs.upload
env:
GITHUB_ACTOR: ${{github.actor}}
GITHUB_TOKEN: ${{github.token}}
run: docker login ghcr.io --username $GITHUB_ACTOR --password-stdin <<<$GITHUB_TOKEN
# Note: Ensure that the GitHub repo has "Role: Write" access to
# chromium-win-cross{,-base} under "Package settings -> Manage
# Actions access", or else the "docker push" operation will fail.
- name: Upload base container image to registry
if: inputs.upload
run: |
remote_name=ghcr.io/${{github.repository_owner}}/chromium-win-cross-base
set -x
docker tag chromium-win-cross-base $remote_name:${{steps.version.outputs.tag}}
docker tag chromium-win-cross-base $remote_name:latest
docker push $remote_name:${{steps.version.outputs.tag}}
docker push $remote_name:latest
- name: Upload MSVC container image to registry
if: inputs.upload
run: |
remote_name=ghcr.io/${{github.repository_owner}}/chromium-win-cross
set -x
docker tag chromium-win-cross $remote_name:${{steps.version.outputs.tag}}
docker tag chromium-win-cross $remote_name:latest
docker push $remote_name:${{steps.version.outputs.tag}}
docker push $remote_name:latest
docker logout ghcr.io
- name: Prepare image metadata
run: |
mkdir artifact
set -x
cp -p cross-build/MD5SUMS.rootfs artifact/
cp -p cross-build/winsysroot/.vsdownload/MD5SUMS.cache artifact/MD5SUMS.msvc-cache
cp -p cross-build/winsysroot/.vsdownload/*.manifest.xz artifact/
xz -d artifact/*.xz
docker container run --rm chromium-win-cross dpkg-query --show > artifact/dpkg-packages.txt
- name: Archive image metadata
uses: actions/upload-artifact@v4
with:
name: image-info
compression-level: 9
path: artifact/
# EOF