-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (112 loc) · 4.38 KB
/
rpm.pip-glibc.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
134
135
136
137
138
139
140
name: pip-glibc RPM
on:
repository_dispatch:
types: [pip-glibc-test-ok]
jobs:
source:
strategy:
fail-fast: false
matrix:
distro: ${{ github.event.client_payload.distros }}
runs-on: ubuntu-latest
steps:
- name: determine configuration
id: config
run: |
pip_glibc_release=3
case ${{ matrix.distro }} in
centos7)
base_name=glibc-2.17-260.el7
base_srpm=http://ftp.pbone.net/mirror/vault.centos.org/7.5.1804/cr/Source/SPackages/${base_name}.src.rpm
base_branch=centos/${base_name}.branch
pip_branch=centos/${base_name}.pip.branch
patch=glibc-el7-pip${pip_glibc_release}.patch
;;
centos8)
base_name=glibc-2.28-72.el8_1.1
base_srpm=http://ftp.pbone.net/mirror/vault.centos.org/8.1.1911/BaseOS/Source/SPackages/${base_name}.src.rpm
base_branch=centos/${base_name}.branch
pip_branch=centos/${base_name}.pip.branch
patch=glibc-el8-pip${pip_glibc_release}.patch
;;
*)
echo >&2 "unknown distro <${{ matrix.distro }}>"
exit 1
;;
esac
echo "::set-output name=pip_glibc_release::${pip_glibc_release}"
echo "::set-output name=base_name::${base_name}"
echo "::set-output name=base_srpm::${base_srpm}"
echo "::set-output name=base_branch::${base_branch}"
echo "::set-output name=pip_branch::${pip_branch}"
echo "::set-output name=patch::${patch}"
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ steps.config.outputs.pip_branch }}
- name: create SRPM
run: |
set -x
distro=${{ matrix.distro }}
pip_glibc_release=${{ steps.config.outputs.pip_glibc_release }}
base_name=${{ steps.config.outputs.base_name }}
base_srpm=${{ steps.config.outputs.base_srpm }}
base_branch=${{ steps.config.outputs.base_branch }}
pip_branch=${{ steps.config.outputs.pip_branch }}
patch=${{ steps.config.outputs.patch }}
git fetch origin ${base_branch}
git diff origin/${base_branch} ${pip_branch} >/tmp/${patch}
cd releng
mv /tmp/${patch} ./
docker run -v $(pwd):/host -e "RPM_BASE_SRPM=${base_srpm}" -e "RPM_PATCH=/host/${patch}" -e 'RPM_SPEC=/host/pip-glibc.spec' -e 'RPM_RESULTS=/host/srpm' ${{ secrets.DOCKERHUB_USER }}/pip-prep:${distro} /host/docker/pip-glibc-rpm/source.sh
- name: Display generated SRPMs
run: ls -lR releng/srpm
- name: upload SRPM
uses: actions/upload-artifact@v2
with:
name: pip-glibc-${{ matrix.distro }}-srpm
path: |
releng/srpm
releng/docker/pip-glibc-rpm
build:
needs: [source]
strategy:
fail-fast: false
matrix:
distro: ${{ github.event.client_payload.distros }}
arch: ${{ github.event.client_payload.archs }}
runs-on: ubuntu-latest
steps:
- name: download SRPM and pip-glibc-rpm scripts
uses: actions/download-artifact@v2
with:
name: pip-glibc-${{ matrix.distro }}-srpm
- name: Display structure of downloaded files
run: ls -lR
- name: Setup QEMU user-mode emulation
uses: docker/setup-qemu-action@v1
- name: create RPM
run: |
set -x
docker run -v $(pwd):/host -e "RPM_SRPM=/host/srpm/*" -e 'RPM_SPEC=pip-glibc.spec' -e 'RPM_RESULTS=/host/rpm' ${{ secrets.DOCKERHUB_USER }}/pip-prep:${{ matrix.distro }}-${{ matrix.arch }} /bin/sh -x /host/docker/pip-glibc-rpm/build.sh
- name: Display generated RPMs
run: ls -lR rpm
- name: upload RPM
uses: actions/upload-artifact@v2
with:
name: pip-glibc-${{ matrix.distro }}-${{ matrix.arch }}-rpm
path: rpm
dispatch:
needs: [build]
strategy:
matrix:
repo: ['${{ github.repository }}' ]
runs-on: ubuntu-latest
steps:
- name: dispatch event
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PIP_BUILD_TOKEN }}
repository: ${{ matrix.repo }}
event-type: pip-glibc-rpm-built
client-payload: '{ "distros": ${{ github.event.client_payload.distros }}, "archtypes": ["multiarch", "amd64", "arm64" ] }'