-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.68 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:
DEPLOY_BRANCH:
required: true
type: string
secrets:
TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: actions/checkout
uses: actions/checkout@v2
- name: actions/checkout ${{ inputs.DEPLOY_BRANCH }}
uses: actions/checkout@v2
with:
ref: ${{ inputs.DEPLOY_BRANCH }}
path: out/maps
- name: jitterbit/get-changed-files
id: files
uses: jitterbit/get-changed-files@v1
- name: install python libs
run: |
sudo apt-get update --fix-missing
sudo apt-get install build-essential
sudo apt-get install python3-pil python3-dev python3-numpy
- name: download minecraft textures
run: |
VERSION=1.16.1
mkdir -p ~/.minecraft/versions/${VERSION}/
wget https://overviewer.org/textures/${VERSION} -O ~/.minecraft/versions/${VERSION}/${VERSION}.jar
- name: build overviewer
run: |
cd /usr/local/src
sudo git clone https://github.com/overviewer/Minecraft-Overviewer.git
cd Minecraft-Overviewer
sudo git checkout 50b84e95b5a9505b6db4c1c0435f54b0a39a292b
sudo curl -O https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/Imaging.h
sudo curl -O https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImagingUtils.h
sudo curl -O https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImPlatform.h
sudo python3 setup.py build
sudo ln -s /usr/local/src/Minecraft-Overviewer/overviewer.py /usr/local/bin/mc-ovw
which mc-ovw
- name: generate maps overview
run: |
arr=(${{ steps.files.outputs.added_modified }})
for path in ${arr[@]}; do
if [[ "$path" == *"/level.dat" ]]; then
mapPath=${path%/level.dat}
outPath=out/$mapPath
mkdir -p $outPath
echo "$mapPath"
mc-ovw --rendermodes=smooth-lighting $mapPath $outPath || true
fi
done
- name: deploy to github pages
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
BASE_BRANCH: ${{ github.base_ref }}
BRANCH: ${{ inputs.DEPLOY_BRANCH }}
FOLDER: out/maps
CLEAN: true
GIT_CONFIG_EMAIL: [email protected]
COMMIT_MESSAGE: Deploy to GitHub Pages - ${{ github.sha }}