-
Notifications
You must be signed in to change notification settings - Fork 3
123 lines (106 loc) · 3.01 KB
/
rw-baseset-build.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
name: Baseset Build
# Build an OpenTTD baseset repository.
on:
workflow_call:
inputs:
apt-packages:
description: A list of apt packages to install.
default: ""
required: false
type: string
name:
description: The name of the project.
required: true
type: string
pip-packages:
description: A list of pip packages to install.
default: ""
required: false
type: string
problem-matcher:
description: A problem matcher to use.
default: ""
required: false
type: string
publish:
description: Whether to publish the bundles.
default: false
required: false
type: boolean
release-date:
description: The release date of the project.
required: true
type: string
version:
description: The version of the project.
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install apt dependencies
if: ${{ inputs.apt-packages != '' }}
shell: bash
run: |
sudo apt update
sudo apt install -y ${{ inputs.apt-packages }} --no-install-recommends
- name: Set up Python 3.8
if: ${{ inputs.pip-packages != '' }}
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install pip dependencies
if: ${{ inputs.pip-packages != '' }}
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install ${{ inputs.pip-packages }}
- name: Install problem matcher
if: ${{ inputs.problem-matcher != '' }}
shell: bash
run: |
echo "::add-matcher::${{ inputs.problem-matcher }}"
- name: Build
shell: bash
run: |
make maintainer-clean
make bundle_zip bundle_xsrc
- name: Move bundles
if: ${{ inputs.publish }}
shell: bash
run: |
mkdir bundles
mv ${{ inputs.name }}-${{ inputs.version }}-source.tar.xz bundles/
mv ${{ inputs.name }}-${{ inputs.version }}-all.zip bundles/
- name: Create checksums
if: ${{ inputs.publish }}
shell: bash
run: |
cd bundles
for i in $(ls); do
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
done
- name: Prepare bundles folder
if: ${{ inputs.publish }}
shell: bash
run: |
cd bundles
echo "${{ inputs.release-date }}" > released.txt
cp ../README.md .
cp ../changelog.txt .
# Show the content of the bundles folder, to make problems debugging easier
ls -l
- name: Upload bundles
if: ${{ inputs.publish }}
uses: actions/upload-artifact@v4
with:
name: bundles
path: bundles/*
if-no-files-found: error
retention-days: 1