-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (129 loc) · 5.01 KB
/
prepare-lima-release.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
name: Prepare QCW Lima (from revision)
on:
workflow_dispatch:
workflow_call:
outputs:
lima_version:
description: "Lima version"
value: ${{ jobs.build.outputs.lima_version }}
gowsllinks_version:
description: "go-wsllinks version"
value: ${{ jobs.build.outputs.gowsllinks_version }}
alpine_version:
description: "Alpine version"
value: ${{ jobs.build.outputs.alpine_version }}
alpine_wsl_version:
description: "Alpine-WSL version"
value: ${{ jobs.build.outputs.alpine_wsl_version }}
env:
LIMA_GITURL: https://github.com/lima-vm/lima.git
LIMA_SHA: e911564e4a5f3151a3beef5ec2446914e016c745
LIMA_VERSION: dev
jobs:
call-prepare-alpine-wsl:
uses: ./.github/workflows/prepare-alpine-wsl-release.yml
call-prepare-go-wsllinks:
uses: ./.github/workflows/prepare-go-wsllinks-release.yml
build:
needs: [call-prepare-go-wsllinks, call-prepare-alpine-wsl]
runs-on: windows-latest
outputs:
lima_version: ${{ steps.make_versions.outputs.lima }}
gowsllinks_version: ${{ steps.make_versions.outputs.gowsllinks }}
alpine_version: ${{ steps.make_versions.outputs.alpine }}
alpine_wsl_version: ${{ steps.make_versions.outputs.alpine_wsl }}
steps:
- name: "🏗️ Install msys2"
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
make git unzip base-devel mingw-w64-ucrt-x86_64-toolchain zip mingw-w64-ucrt-x86_64-go
- name: "📝 Configure checkout"
run: git config --global core.autocrlf input
- name: "📝 Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: "🛻 Donwload artifacts"
uses: actions/download-artifact@v4
with:
path: qcw-art
- name: "🏗️ Install lima-infra"
shell: pwsh
run: |
wsl --set-default-version 2
wsl --shutdown
Import-module -Name Appx -UseWindowsPowerShell
Add-AppxPackage https://github.com/microsoft/WSL/releases/download/2.4.9/Microsoft.WSL_2.4.9.0_x64_ARM64.msixbundle
wsl --version
wsl --install --from-file qcw-art/qcw-alpine/lima-infra.wsl
wsl -l -v
# workaround for oobe https://github.com/microsoft/WSL/issues/12398
- name: "✅ Check user"
shell: pwsh
run: |
cmd /c "start wsl -d lima-infra"
sleep 5
wsl -d lima-infra whoami
wsl -d lima-infra -u lima whoami
- name: "📝 Fetch sources"
shell: msys2 {0}
run: |
mkdir lima-release
cd lima-release
git init
git remote add origin $LIMA_GITURL
git fetch --depth 1 origin $LIMA_SHA
git checkout FETCH_HEAD
patch --binary -l -p 1 < ../patches/lima/0001-Add-QEMU-driver-support-on-Windows-hosts.patch
- name: "🛠️ Build Lima"
working-directory: lima-release
shell: msys2 {0}
run: |
cp -f ../qcw-art/qcw-go-wsllinks/go-wsllinks.exe ./contrib/bundle-wsl/go-wsllinks.exe
make binaries add-bundles
- name: "🧪 Test Lima toolkit"
working-directory: lima-release/_output/bin/bundle-wsl
shell: pwsh
run: |
dir
wsl -d lima-infra -u lima cygpath c:/test/out1
.\cygpath c:/test/out2
- name: "🧪 Test Lima WSL2"
working-directory: lima-release/_output/bin
shell: pwsh
run: |
.\limactl start template://experimental/wsl2
type C:\Users\runneradmin\.lima\wsl2\ha.stdout.log
type C:\Users\runneradmin\.lima\wsl2\ha.stderr.log
- name: "📦 Pack Lima"
shell: msys2 {0}
run: |
mkdir -p qcw
mkdir -p qcw-tmp
cp -r "lima-release/_output" qcw-tmp/lima
cd qcw-tmp/
zip -9 -r ../qcw/lima.zip .
cd ../qcw
find . -type f \( ! -iname "*.checksums" \) -exec sha256sum -b {} \; > sha.checksums
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
cat sha.checksums
- id: make_versions
name: "📌 Export versions"
env:
GOWSLLINKS_VERSION: ${{ needs.call-prepare-go-wsllinks.outputs.gowsllinks_version }}
ALPINE_VERSION: ${{ needs.call-prepare-alpine-wsl.outputs.alpine_version }}
ALPINEWSL_VERSION: ${{ needs.call-prepare-alpine-wsl.outputs.alpine_wsl_version }}
shell: msys2 {0}
run: |
echo "lima=$LIMA_VERSION-$LIMA_SHA" >> "$GITHUB_OUTPUT"
echo "gowsllinks=$GOWSLLINKS_VERSION" >> "$GITHUB_OUTPUT"
echo "alpine=$ALPINE_VERSION" >> "$GITHUB_OUTPUT"
echo "alpine_wsl=$ALPINE_WSL_VERSION" >> "$GITHUB_OUTPUT"
- name: "🚀 Upload artifact"
uses: actions/upload-artifact@v4
with:
name: qcw-lima
path: qcw