forked from msys2/MSYS2-packages
-
Notifications
You must be signed in to change notification settings - Fork 32
129 lines (122 loc) · 4.63 KB
/
main.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: main
on: [pull_request]
jobs:
build:
if: "!startsWith(github.event.pull_request.title, 'i686:') && !contains(github.event.pull_request.title, 'msys2-runtime-3.3')"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to determine which packages to build
- uses: git-for-windows/setup-git-for-windows-sdk@v1
with:
flavor: full
msys: true
- name: install pactoys (needed for `saneman`)
shell: bash
run: bash -lc "pacman -S --noconfirm pactoys"
- name: work around curl v8.11.0-1 problem
shell: bash
run: |
# `git fetch` does not work with that libcurl version. For details,
# see https://github.com/git-for-windows/MSYS2-packages/pull/199
test ! -f /var/lib/pacman/local/libcurl-8.11.0-1/desc ||
for pkg in libcurl curl
do
for suffix in '' .sig
do
curl --retry 5 -fLO \
https://wingit.blob.core.windows.net/x86-64/$pkg-8.10.1-1-x86_64.pkg.tar.xz$suffix ||
exit 1
done
pacman -U --noconfirm $pkg-8.10.1-1-x86_64.pkg.tar.xz || exit 1
done
# Sadly, this does not work because the Pacman repository's index only
# ever lists the latest package version:
# pacman -S --noconfirm libcurl=8.10.1-1 curl=8.10.1-1
- name: CI-Build
shell: bash
run: bash -l .ci/ci-build.sh
env:
MSYSTEM: MSYS
MAKEFLAGS: -j5
MSYS2_PATH_TYPE: minimal
- name: "Upload binaries"
uses: actions/upload-artifact@v4
with:
name: msys2-packages
path: artifacts/*.pkg.tar.*
build-i686:
if: "!contains(github.event.pull_request.title, 'msys2-runtime') || contains(github.event.pull_request.title, 'msys2-runtime-3.3')"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to determine which packages to build
- uses: git-for-windows/setup-git-for-windows-sdk@v1
with:
flavor: full
architecture: i686
msys: true
- name: rebase `.dll` base addresses
shell: powershell
run: |
if (Test-Path D:\git-sdk-32-full -PathType Container) {
cd D:\git-sdk-32-full
} else {
cd C:\git-sdk-32-full
}
if (!$?) { exit(1); }
$env:MSYSTEM = "MINGW32"
$env:PATH = "$(Get-Location)\usr\bin;" + $env:PATH
$env:MSYS2_PATH_TYPE = "minimal"
# Disable pacman's post-transaction hook that would mess everything up, if it exists
sh.exe -lc "set -x && rm -f /usr/share/libalpm/hooks/rebase.hook"
sh.exe -lc "set -x && find /usr/lib/perl5/*_perl -name \*.dll >perl-dlls.txt"
type perl-dlls.txt
dash -x /usr/bin/rebaseall -p -T perl-dlls.txt
# Work around for:
# - address space needed by 'Cwd.dll' is already occupied
# - address space needed by 'Dumper.dll' is already occupied
# etc
bash -lc "set -x && rebase -b 0x61500000 /usr/lib/perl5/core_perl/auto/*/{*,*/*}.dll"
# Work around for:
# - address space needed by 'Cwd.dll' is already occupied
bash -lc "set -x && rebase -v -b 0x63f00000 /usr/lib/perl5/core_perl/auto/Cwd/Cwd.dll"
# verify the base address
bash -lc "set -x && rebase -v -i /usr/lib/perl5/core_perl/auto/Cwd/Cwd.dll"
- name: CI-Build (i686)
shell: bash
run: |
set -x &&
mkdir -p artifacts &&
err= &&
for dir in $(git diff --name-only \
${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} |
sed -n 's/^\([a-z][^/]*\)\/.*/\1/p' |
sort |
uniq)
do
case $dir in msys2-runtime) continue;; esac
(
cd $dir &&
../.ci/fetch-validpgpkeys.sh &&
makepkg -s --noconfirm &&
cp -v *.pkg.tar.* ../artifacts/
) ||
err="$err $dir"
done &&
test -z "$err" || {
echo "::error::Build failures in$err" >&2
exit 1
}
env:
MSYSTEM: MSYS
MAKEFLAGS: -j5
MSYS2_PATH_TYPE: minimal
GIT_CONFIG_PARAMETERS: "'user.name=ci' '[email protected]'"
- name: "Upload binaries"
uses: actions/upload-artifact@v4
with:
name: msys2-packages-i686
path: artifacts/*.pkg.tar.*