forked from neroden/simutrans-pak128.britain
-
Notifications
You must be signed in to change notification settings - Fork 22
80 lines (73 loc) · 2.55 KB
/
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
name: Build
on:
workflow_call:
inputs:
pakset_ref:
description: 'The commit hash, branch or tag name of the pakset to use.'
type: string
default: master
required: false
simutrans_repository:
description: 'The owner of the simutrans-extended repository'
type: string
default: simutrans/simutrans-extended
required: false
simutrans_ref:
description: 'The commit hash, branch or tag name of the simutrans-extended build to use.'
type: string
default: Nightly
required: false
jobs:
build:
name: Build the pakset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.pakset_ref }}
- name: Set env.pakset_hash
run: echo "pakset_hash=$(git rev-parse ${{ inputs.pakset_ref }})" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
repository: ${{ inputs.simutrans_repository }}
ref: ${{ inputs.simutrans_ref }}
path: simutrans-extended
- name: Set env.simutrans_hash
run: |
cd ./simutrans-extended
echo "simutrans_hash=$(git rev-parse ${{ inputs.simutrans_ref }})" >> $GITHUB_ENV
cd ..
rm -rf ./simutrans-extended
- name: Load Build Cache
uses: actions/cache@v2
id: cache
with:
path: ./pak128.Britain-Ex
key: nightly-${{ env.pakset_hash }}@${{ env.simutrans_hash }}
- name: Get makeobj
if: steps.cache.outputs.cache-hit != 'true'
uses: dawidd6/action-download-artifact@v2
with:
repo: simutrans/simutrans-extended
workflow: ci.yml
commit: ${{ env.simutrans_hash }}
workflow_conclusion: success
path: .
name: makeobj-linux-nightly
- name: Build the pak
if: steps.cache.outputs.cache-hit != 'true'
run: |
chmod +x ./makeobj-extended
make
echo "{
\"timestamp\" : \"$(date)\",
\"pakset_version\" : \"${{ env.pakset_hash }}\",
\"makeobj_version\" : \"${{ env.simutrans_hash }}\"
}" > ./pak128.Britain-Ex/build-metadata.json
ls -l
#Workarround to bypass the restriction of workflow run output variables (currently not supported, but will be in a later release according to the github roadmap)
- name: upload build metadata
uses: actions/upload-artifact@v2
with:
name: build-metadata
path: ./pak128.Britain-Ex/build-metadata.json