-
-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (148 loc) · 5.83 KB
/
ci.yml
File metadata and controls
176 lines (148 loc) · 5.83 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
# Automated build of the:
# * riscos-build-online tool for linux.
# * riscos-build-online deb for Linux.
# * riscos-build-online Absolute for RISC OS.
name: CI
# Controls when the action will run. Triggers the workflow on:
# * push or pull request on any branch.
# * tag creation for tags beginning with a 'v'
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
create:
tags:
- v*
jobs:
build-linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
leafname_deb: ${{ steps.version.outputs.leafname_deb }}
leafname_tool: ${{ steps.version.outputs.leafname_tool }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Build the linux binary and the deb
run: |
# Regular run would use:
# make riscos-build-online
# However, if we do that, we get a binary that uses
# GLIBC which is too new to run on Ubuntu 18.04. So
# we can build on an earlier system:
docker run --rm --init -v $PWD:/source -w /source cuihairu/ubuntu:18.04-gcc bash -c 'apt-get update && apt-get install -y libssl-dev && make riscos-build-online'
- name: Run a test against the live build server
run: make test
- name: Build the deb
run: |
CHANGENUM=$(git rev-list --count HEAD)
docker run --rm --init -v $PWD:/source -w /source cuihairu/ubuntu:18.04-gcc bash -c "apt-get update && apt-get install -y libssl-dev && make deb CHANGENUM=${CHANGENUM}"
- name: Work out the names of the files
id: version
run: |
shopt -s failglob
set +o noglob
deb=$(ls riscos-build-online_*.deb)
echo "leafname_tool=riscos-build-online" >> $GITHUB_OUTPUT
echo "leafname_deb=$deb" >> $GITHUB_OUTPUT
echo "deb name is '$deb'"
- uses: actions/upload-artifact@v7
with:
name: riscos-build-online-linux-tool
path: riscos-build-online
- uses: actions/upload-artifact@v7
with:
name: riscos-build-online-linux-deb
path: ${{ steps.version.outputs.leafname_deb }}
build-riscos:
needs: build-linux
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: riscos-build-server
outputs:
version: ${{ steps.version.outputs.version }}
leafname: ${{ steps.version.outputs.leafname }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Download built Linux binary
uses: actions/download-artifact@v8
with:
name: riscos-build-online-linux-tool
path: riscos-build-online-linux-tool
# We use the tool we've just built to create the RISC OS version.
- name: Build through build.riscos.online
run: |
zip -q9r /tmp/source-archive.zip * .robuild.yaml
chmod +x riscos-build-online-linux-tool/riscos-build-online
riscos-build-online-linux-tool/riscos-build-online -i /tmp/source-archive.zip -t 600 -o /tmp/riscos-build-online
- name: Give the output a versioned name
id: version
run: |
if [[ -f VersionNum ]] ; then
version=$(sed '/MajorVersion / ! d ; s/.*MajorVersion *"\(.*\)"/\1/' VersionNum)
else
version=$(git rev-parse --short HEAD)
fi
echo "This is version: $version"
leafname="riscos-build-online,ff8"
dirname="robuild-client"
filename="$dirname/$leafname"
if [ -f /tmp/riscos-build-online,ff8 ] ; then
mkdir -p "$dirname"
cp /tmp/riscos-build-online,ff8 "$filename"
else
echo "No archive was built?"
exit 1
fi
echo "version=$version" >> $GITHUB_OUTPUT
echo "leafname=$leafname" >> $GITHUB_OUTPUT
echo "filename=$filename" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v7
with:
name: riscos-build-online-riscos-tool
path: ${{ steps.version.outputs.filename }}
# The artifact that is downloadable from the Actions is actually a zip of the artifacts
# that we supply. So it will be a regular Zip file containing a RISC OS Zip file.
# (but when it's released it will be just the content from the zip archive)
# The release only triggers when the thing that was pushed was a tag starting with 'v'
release:
needs:
- build-riscos
- build-linux
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download built RISC OS binary
uses: actions/download-artifact@v8
with:
name: riscos-build-online-riscos-tool
path: riscos-build-online-riscos-tool
- name: Download built Linux binary
uses: actions/download-artifact@v8
with:
name: riscos-build-online-linux-tool
- name: Download built Linux deb
uses: actions/download-artifact@v8
with:
name: riscos-build-online-linux-deb
- name: Archive the RISC OS file directory
run: |
zip -9r riscos-build-online-riscos-tool.zip riscos-build-online-riscos-tool
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
prerelease: false
draft: true
artifacts: "riscos-build-online-riscos-tool.zip,${{ needs.build-linux.outputs.leafname_deb }},${{ needs.build-linux.outputs.leafname_tool }}"