forked from GitTerraGame/Play-GitTerra-Action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
79 lines (68 loc) · 2.31 KB
/
action.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
name: play-gitterra
description: This action will let you play GitTerra game in your repository
author: GitTerra Team
branding:
icon: "map"
color: "blue"
runs:
using: "composite"
steps:
- run: echo "Let's play GitTerra game"
shell: "bash"
- name: Opening the scrolls of wisdom
uses: actions/checkout@v4
with:
path: "scrolls"
- name: Asking our wizard to extract the inner knowledge
id: cache-scc
uses: actions/cache@v4
env:
cache-name: our-wizard
with:
# we don't expect SCC to change, just use the same version all the time
path: wizard/
key: ${{ env.cache-name }}
- if: ${{ steps.cache-scc.outputs.cache-hit != 'true' }}
name: Inviting a wizard from a distant land
run: |
mkdir -p wizard
wget https://github.com/boyter/scc/releases/download/v3.2.0/scc_Linux_x86_64.tar.gz -O wizard/scc.gz
tar -C wizard/ -xvf wizard/scc.gz
shell: "bash"
- name: Extracting the inner knowledge hidden inside the scrolls
run: time wizard/scc scrolls/ --by-file --format json --output gitterra.json
shell: "bash"
- name: Transporting builders to the construction site
uses: actions/checkout@v4
with:
repository: "GitTerraGame/Play-GitTerra-Action"
path: "builders"
- name: Looking for a stash of existing tools
id: cache-npm
uses: actions/cache@v4
env:
cache-name: tool-stash
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('builders/package-lock.json') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-
${{ env.cache-name }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Check the empty stash
continue-on-error: true
shell: "bash"
run: npm list
- name: Equipping builders with the tools
run: (cd builders && npm ci)
shell: "bash"
- name: Building the city of GitTerra
run: node builders/src/generateMap.js scrolls/.gitterra.config.js
shell: "bash"
- name: Archive the maps in the player's library
uses: actions/upload-artifact@v4
with:
name: gitterra
path: |
index.html