Skip to content

Commit 217bc9b

Browse files
authored
Initial commit
0 parents  commit 217bc9b

38 files changed

+25463
-0
lines changed

.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# Log level (0 = none, 1 = info, 2 = verbose)
3+
LOG_LEVEL=1
4+
5+
# Tileset optimization
6+
TILESET_OPTIMIZATION=false
7+
# Tileset optimization quality (0.0 - 1.0)
8+
TILESET_OPTIMIZATION_QUALITY_MIN=0.9
9+
TILESET_OPTIMIZATION_QUALITY_MAX=1.0
10+
11+
# Here you can set your upload strategy. Simply comment the option you don't want to use.
12+
# Learn more by reading the 'Upload your map' section in the README.
13+
# UPLOAD_MODE=MAP_STORAGE
14+
UPLOAD_MODE=GH_PAGES
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build and deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch: # allow manual execution
8+
9+
permissions:
10+
contents: write
11+
pages: write
12+
actions: write
13+
14+
jobs:
15+
build-and-deploy:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: "18.x"
26+
registry-url: "https://registry.npmjs.org"
27+
28+
- name: Install Dependencies
29+
run: npm install
30+
31+
- name: Build project
32+
run: npm run build
33+
34+
- name: Extract UPLOAD_MODE from .env
35+
run: |
36+
UPLOAD_MODE=$(grep '^[^#]*UPLOAD_MODE' .env | cut -d '=' -f2)
37+
if [ -z "$UPLOAD_MODE" ]; then
38+
echo "Error: UPLOAD_MODE is not set in .env."
39+
exit 1
40+
fi
41+
echo "UPLOAD_MODE=$UPLOAD_MODE" >> $GITHUB_ENV
42+
43+
- name: Set up Environment Variables
44+
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
45+
run: |
46+
# MAP_STORAGE_API_KEY must always come from GitHub Secrets in CI
47+
if [ -z "${{ secrets.MAP_STORAGE_API_KEY }}" ]; then
48+
echo "Error: MAP_STORAGE_API_KEY is not set in GitHub Secrets."
49+
exit 1
50+
fi
51+
echo "MAP_STORAGE_API_KEY=${{ secrets.MAP_STORAGE_API_KEY }}" >> $GITHUB_ENV
52+
53+
# MAP_STORAGE_URL can fall back to .env if not in GitHub Secrets
54+
if [ -n "${{ secrets.MAP_STORAGE_URL }}" ]; then
55+
echo "MAP_STORAGE_URL=${{ secrets.MAP_STORAGE_URL }}" >> $GITHUB_ENV
56+
else
57+
MAP_STORAGE_URL=$(grep '^[^#]*MAP_STORAGE_URL' .env | cut -d '=' -f2)
58+
if [ -z "$MAP_STORAGE_URL" ]; then
59+
echo "Error: MAP_STORAGE_URL is not set in GitHub Secrets or .env."
60+
exit 1
61+
fi
62+
echo "MAP_STORAGE_URL=$MAP_STORAGE_URL" >> $GITHUB_ENV
63+
fi
64+
65+
# UPLOAD_DIRECTORY can fall back to .env if not in GitHub Secrets, and to an arbitrary value if not in .env
66+
if [ -n "${{ secrets.UPLOAD_DIRECTORY }}" ]; then
67+
echo "UPLOAD_DIRECTORY=${{ secrets.UPLOAD_DIRECTORY }}" >> $GITHUB_ENV
68+
else
69+
UPLOAD_DIRECTORY=$(grep '^[^#]*UPLOAD_DIRECTORY' .env | cut -d '=' -f2)
70+
if [ -n "$UPLOAD_DIRECTORY" ]; then
71+
echo "UPLOAD_DIRECTORY=$UPLOAD_DIRECTORY" >> $GITHUB_ENV
72+
else
73+
USERNAME=${{ github.repository_owner }}
74+
REPO=${{ github.event.repository.name }}
75+
UPLOAD_DIRECTORY="${USERNAME}-${REPO}"
76+
echo "UPLOAD_DIRECTORY=$UPLOAD_DIRECTORY" >> $GITHUB_ENV
77+
echo "Warning: UPLOAD_DIRECTORY was not found; set to $UPLOAD_DIRECTORY."
78+
fi
79+
fi
80+
81+
- name: Deploy using WA Map Storage
82+
if: ${{ env.UPLOAD_MODE == 'MAP_STORAGE' }}
83+
run: npm run upload-only
84+
85+
- name: Deploy using Github Pages
86+
if: ${{ env.UPLOAD_MODE == 'GH_PAGES' }}
87+
uses: JamesIves/github-pages-deploy-action@releases/v3
88+
with:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
BRANCH: gh-pages
91+
FOLDER: dist/
92+
BASE_BRANCH: master
93+

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
.env.secret
26+
dist.zip

LICENSE.assets

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ASSETS LICENSE
2+
3+
(Notice)
4+
Assets distributed with a map are subject to different licenses.
5+
The license attributed to each tileset can be found or have to be added in the "tilesetCopyright" property of each tileset in the map.
6+
In addition, you have to add a section below with the specific license of the asset you want to use.
7+
8+
9+
WORKADVENTURE SPECIFIC RESOURCES LICENSE
10+
11+
The User shall handle assets with the WorkAdventure specific resources license as follows:
12+
13+
1. These Assets may be used only in maps produced for WorkAdventure (SAAS or self-hosted version).
14+
15+
2. These Assets may be modified (colors or size changed, inverted, trimmed, etc.) only for purposes of use in maps produced for WorkAdventure (SAAS or self-hosted version).
16+
17+
3. These Assets or those modified pursuant to the previous item may undergo Distribution, etc. with maps produced for WorkAdventure. Furthermore, the User may not perform Distribution, etc. of individual Assets or those modified, or Distribution, etc. in combination with programs, etc. other than the map. However, the User may duplicate, transfer, publicly transmit, or enable transmission of personally-modified Assets to other Authorized Users free of charge.

LICENSE.code

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CODE LICENSE
2+
3+
4+
MIT License
5+
6+
Copyright (c) 2021 TheCodingMachine
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)