-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (112 loc) · 3.46 KB
/
mapbuilder.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
124
125
126
127
128
129
130
# Direct from Repository
name: mapbuilder
run-name: Building maps for commit ${{ github.sha }} by ${{ github.actor }}
on:
push:
branches:
- "*"
- "*/**"
- "!main"
# paths:
# - 'mapdata/**'
workflow_dispatch:
branches:
- "*"
- "*/**"
- "!main"
# paths:
# - 'mapdata/**'
permissions: write-all
jobs:
mapbuilder-build-maps:
runs-on: ubuntu-latest
steps:
- name: Checkout repo content
uses: actions/checkout@v4 # checkout the repository content
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.12" # install the python version needed
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
working-directory: ./.github/workflows/mapbuilder
run: poetry install
- name: Execute script # run mapbuilder
working-directory: ./.github/workflows/mapbuilder
run: poetry run mapbuilder --debug -s "../../../mapdata" "../../../EDGG"
- name: Execute old Mover script # run moverWithImports.py
working-directory: .
run: python .github/workflows/moverWithImports.py
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "[AUTO] mapbuilder ${{ github.sha }}" --allow-empty)
- name: push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
# via Docker
# name: mapbuilder
# run-name: Building maps for commit ${{ github.sha }} by ${{ github.actor }}
# on:
# push:
# branches:
# - "*"
# - "*/**"
# - "!main"
# paths:
# - 'mapdata/**'
# workflow_dispatch:
# branches:
# - "*"
# - "*/**"
# - "!main"
# paths:
# - 'mapdata/**'
# permissions: write-all
# jobs:
# build-maps:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Restore cached sources
# uses: actions/cache/restore@v4
# with:
# path: .cache
# key: sources
# - name: Run mapbuilder
# uses: sergej-singer/mapbuilder@edgg
# with:
# target-path: 'EDGG'
# source-path: 'mapdata'
# - name: Store cached sources
# uses: actions/cache/save@v4
# with:
# path: .cache
# key: sources
#
# - name: Commit files
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git add -A
# git diff-index --quiet HEAD || (git commit -a -m "[AUTO] mapbuilder ${{ github.sha }}" --allow-empty)
#
# - name: push changes
# uses: ad-m/[email protected]
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref }}