-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
139 lines (113 loc) · 4.04 KB
/
.gitlab-ci.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
# RISC OS CI build for libxslt library and tool.
#
# Enable submodules
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
#### Builds ####
cross-compile:
# Builds using the cross-compiling toolchain
stage: build
script:
- |
cd libxml2/RISCOS
riscos-amu -f MakefileLib,fe1 export
cd ../..
- |
cd RISCOS
./build-release.sh
cd ..
artifacts:
paths:
- RISCOS
expire_in: 1 day
tags:
- riscos
#### Test by running this on build.riscos.online
test:
stage: test
needs:
- cross-compile
dependencies:
- cross-compile
script:
- |
cd RISCOS
# Zip up the source to send to robuild
zip -q9r /tmp/source-archive.zip xsltproc/aif32 ROTest,feb testdata .robuild.yaml
# Fetch the build client
curl -s -L -o riscos-build-online https://github.com/gerph/robuild-client/releases/download/v0.05/riscos-build-online && chmod +x riscos-build-online
# Send the archive file to build service
# Note: This is being sent directly to the back end to avoid the gateway that times out at 10 minutes.
./riscos-build-online -i /tmp/source-archive.zip -a off -o /tmp/built
#### Build archive by making the zip in RISC OS format
archive:
stage: archive
needs:
- cross-compile
dependencies:
- cross-compile
script:
- |
cd RISCOS/Release
# Archive the release files in RISC OS format
pip install --user rozipinfo
python -m rozipfile --verbose --create ../../archive.zip *
echo RISC OS archive contents:
python -m rozipfile --list ../../archive.zip
cd ../..
- |
# If we wanted to version it by the library version, we could use this
libxslt_version=$(sed '/define LIBXSLT_DOTTED_VERSION/ ! d ; s/.*LIBXSLT_DOTTED_VERSION *"\(.*\)"/\1/' RISCOS/libxslt/h/xsltconfig)
# Except, I've been versioning the earlier versions with port version numbers.
# So let's use that.
version=$(sed '/MajorVersion / ! d ; s/.*MajorVersion *"\(.*\)"/\1/' RISCOS/xsltproc/VersionNum)
# Note: We don't include the git hash here; it makes referencing a release version harder if you have to
# include the hash in the version number.
#version=$version-$(git rev-parse --short HEAD)
echo "This is version: $version (of LibXSLT $libxslt_version)"
mv archive.zip LibXSLT-$version.zip
artifacts:
when: always
paths:
- LibXSLT-*.zip
#### Build with build service ####
# (too slow to build right now)
.robuild:
# Builds using the RISC OS Build service.
stage: build
script:
- |
set -o pipefail
# Zip up the source to send to robuild
zip -q9r /tmp/source-archive.zip * .robuild.yaml
# Fetch the build client
curl -s -L -o riscos-build-online https://github.com/gerph/robuild-client/releases/download/v0.05/riscos-build-online && chmod +x riscos-build-online
# Send the archive file to build service
# Note: This is being sent directly to the back end to avoid the gateway that times out at 10 minutes.
./riscos-build-online -i /tmp/source-archive.zip -a off -s ws://backend0.build.riscos.online:13254/ -t 1800 -o /tmp/built
- |
# If we wanted to version it by the library version, we could use this
libxslt_version=$(sed '/define LIBXSLT_DOTTED_VERSION/ ! d ; s/.*LIBXSLT_DOTTED_VERSION *"\(.*\)"/\1/' RISCOS/libxslt/h/xsltconfig)
# Except, I've been versioning the earlier versions with port version numbers.
# So let's use that.
version=$(sed '/MajorVersion / ! d ; s/.*MajorVersion *"\(.*\)"/\1/' RISCOS/xsltproc/VersionNum)
version=$version-$(git rev-parse --short HEAD)
echo "This is version: $version (of LibXSLT $libxslt_version)"
if [ -f /tmp/built,a91 ] ; then
cp /tmp/built,a91 "LibXSLT-$version.zip"
else
echo "No archive was built?"
exit 1
fi
artifacts:
when: always
paths:
- LibXSLT-*.zip
tags:
- linux
#### Stages to execute ####
stages:
- build
- test
- archive