-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.dist.yaml
60 lines (57 loc) · 1.85 KB
/
Taskfile.dist.yaml
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
version: '3'
vars:
IMAGE_BUILDER_CMD: docker
IMAGE_NAME: ghcr.io/jamcole/minecraft-bedrock-image
tasks:
default:
cmds:
- task: build
url-get:
run: once
generates:
- src/resources/bedrock-url.txt
status:
- test -f src/resources/bedrock-url.txt
cmds:
- curl -s -L -A Edge/10000 "https://www.minecraft.net/en-us/download/server/bedrock" | grep -i 'href=' | grep -i linux | grep -Eo 'https?:[^\"]+.zip' | grep -vi preview | head -n 1 > src/resources/bedrock-url.txt
version-get:
run: once
sources:
- src/resources/bedrock-url.txt
generates:
- src/resources/bedrock-version.txt
status:
- test -f src/resources/bedrock-version.txt
cmds:
- grep -Eo '([0-9\.]*[0-9]+)+' src/resources/bedrock-url.txt > src/resources/bedrock-version.txt
deps:
- url-get
build:
run: always
envs:
DOCKER_BUILDKIT: 1
cmds:
- sh -c '{{.IMAGE_BUILDER_CMD}} build --progress plain --tag {{.IMAGE_NAME}}:v$(cat src/resources/bedrock-version.txt) .'
requires:
vars: [IMAGE_BUILDER_CMD, IMAGE_NAME]
deps:
- version-get
git-tag:
run: always
cmds:
- git pull --tags -f
- git add .
- git commit -m "version update" && bash -c 'git show-ref --tags v$(cat src/resources/bedrock-version.txt) --quiet && git tag -a -m "update to existing tag" v$(cat src/resources/bedrock-version.txt)-$(date +%s) || git tag -a -m "new tag" v$(cat src/resources/bedrock-version.txt)' || true
- git show-ref --tags v$(cat src/resources/bedrock-version.txt) --quiet || git tag -a -m "new tag" v$(cat src/resources/bedrock-version.txt)
- git push --follow-tags
deps:
- version-get
clean:
status:
- false
cmds:
- for: sources
cmd: '[ -f "{{ .ITEM }}" ] && rm "{{ .ITEM }}"'
sources:
- src/resources/bedrock-url.txt
- src/resources/bedrock-version.txt