-
Notifications
You must be signed in to change notification settings - Fork 7
103 lines (91 loc) · 3.34 KB
/
wkdev-sdk.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
name: wkdev-sdk
on:
push:
branches: [ main, tag/** ]
paths-ignore: [ docs/*, README.md]
pull_request:
paths-ignore: [ docs/*, README.md]
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Set tag name
run: |
if [ "${GITHUB_BASE_REF}" = 'main' ]; then
tag_name='latest'
elif [[ "${GITHUB_BASE_REF}" =~ ^tag/(.*)$ ]]; then
tag_name="${BASH_REMATCH[1]}"
else
tag_name="${GITHUB_BASE_REF}"
fi
echo "WKDEV_SDK_TAG=${tag_name}" >> "${GITHUB_OUTPUT}"
echo "WKDEV_SDK_CONTAINER_REGISTRY_USER_NAME=${GITHUB_REPOSITORY_OWNER}" >> "${GITHUB_OUTPUT}"
- name: Increase storage space
uses: easimon/maximize-build-space@master
with:
# Podman uses an insane amount of storage during creation of the image.
# This must be a bug as 20GB (the default) truly isn't large enough.
# TODO: Ensure fuse-overlayfs is working as expected.
root-reserve-mb: 30720
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true
- name: Install podman
uses: gacts/install-podman@v1
- name: Install fuse-overlayfs
run: sudo apt-get -y install fuse-overlayfs
- name: Checkout repo
uses: actions/checkout@v4
- name: Build image
run: |
source ./register-sdk-on-host.sh
wkdev-sdk-bakery --mode=build --verbose
wkdev-sdk-bakery --mode=export --verbose
- name: Archive image
uses: actions/upload-artifact@v4
with:
name: wkdev-sdk.tar
path: wkdev-sdk.tar
retention-days: 7
- name: Test image
run: |
source ./register-sdk-on-host.sh
wkdev-create --create-home --verbose --attach --no-pull
wkdev-enter --exec -- git clone --depth=1 https://github.com/WebKit/WebKit.git
wkdev-enter --exec -- ./WebKit/Tools/Scripts/build-webkit --wpe --release --generate-project-only
wkdev-enter --exec -- ./WebKit/Tools/Scripts/build-webkit --gtk --release --generate-project-only
deploy:
runs-on: ubuntu-22.04
needs: build
if: github.ref_name == 'main' || startsWith(github.ref_name, 'tag/')
steps:
- name: Set tag name
run: |
if [ "${GITHUB_BASE_REF}" = 'main' ]; then
tag_name='latest'
elif [[ "${GITHUB_BASE_REF}" =~ ^tag/(.*)$ ]]; then
tag_name="${BASH_REMATCH[1]}"
else
tag_name="${GITHUB_BASE_REF}"
fi
echo "WKDEV_SDK_TAG=${tag_name}" >> "${GITHUB_OUTPUT}"
echo "WKDEV_SDK_CONTAINER_REGISTRY_USER_NAME=${GITHUB_REPOSITORY_OWNER}" >> "${GITHUB_OUTPUT}"
- name: Install podman
uses: gacts/install-podman@v1
- name: Checkout repo
uses: actions/checkout@v4
- name: Download image
uses: actions/download-artifact@v4
with:
name: wkdev-sdk.tar
- name: Deploy image
run: |
podman load < wkdev-sdk.tar
echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io --username=${GITHUB_REPOSITORY_OWNER} --password-stdin
source ./register-sdk-on-host.sh
wkdev-sdk-bakery --mode=deploy --verbose