Skip to content

Commit

Permalink
Use the latest.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Dec 19, 2023
1 parent 74e2e5e commit 53f3fe2
Show file tree
Hide file tree
Showing 22 changed files with 803 additions and 649 deletions.
55 changes: 27 additions & 28 deletions .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ inputs:
tests:
description: Unit tests.
default: false
deploy:
description: Deploy game.
default: false
deploy-platform:
description: Deploy game platform.
required: false
deploy-platform-target:
description: Deploy game target.
required: false
platform:
description: Target platform.
required: false
Expand All @@ -23,35 +32,25 @@ inputs:
runs:
using: "composite"
steps:
- name: Install llvm-mingw
shell: bash
run: |
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20230130/llvm-mingw-20230130-ucrt-ubuntu-18.04-x86_64.tar.xz
tar -xf llvm-mingw-20230130-ucrt-ubuntu-18.04-x86_64.tar.xz
mv llvm-mingw-20230130-ucrt-ubuntu-18.04-x86_64 llvm-mingw
- name: Scons Build
shell: sh
shell: bash
env:
SCONSFLAGS: ${{ inputs.sconsflags }}
SCONS_CACHE: ${{ inputs.scons-cache }}
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
SCONSFLAGS: ${{ inputs.sconsflags }}
SCONS_CACHE: ${{ inputs.scons-cache }}
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
run: |
mkdir -p bin modules/mono/glue
cd godot
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
if [ "${{ inputs.target }}" != "editor" ]; then rm -rf editor; fi # Ensure we don't include editor code.
export PATH="$PWD/../llvm-mingw/bin:$PATH"
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
ls -l bin/
# - name: Generate GUT tests
# if: ${{ matrix.tests }}
# shell: sh
# run: |
# godot/${{ matrix.bin }} --headless --path . -s res://addons/gut/gut_cmdln.gd --xr-mode off

# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: ${{ matrix.tests }}
# with:
# report_paths: '**/vsk_default/test/results/TEST_*.xml'
if [[ "${{ inputs.deploy }}" == "true" ]]; then
PLATFORM=${{ inputs.deploy-platform }}
TARGET=${{ inputs.deploy-platform-target }}
else
PLATFORM=${{ inputs.platform }}
TARGET=${{ inputs.target }}
fi
echo "Building with flags:" platform=$PLATFORM target=$TARGET tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
if [ "$TARGET" != "editor" ]; then rm -rf editor; fi # Ensure we don't include editor code.
scons platform=$PLATFORM target=$TARGET tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
cp -r bin/* ../bin
cp -r modules/mono/glue/* ../modules/mono/glue
ls -l ../bin
4 changes: 2 additions & 2 deletions .github/actions/godot-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ runs:
using: "composite"
steps:
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
uses: actions/cache@v3
- name: Always upload .scons_cache directory
uses: pat-s/always-upload-cache@v3.0.11
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
Expand Down
44 changes: 23 additions & 21 deletions .github/actions/godot-deps/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
name: Setup python and scons
description: Setup python, install the pip version of scons.
name: Setup python, scons and golang
description: Setup python, install the pip version of scons and setup golang.
inputs:
python-version:
description: The python version to use.
default: "3.x"
python-arch:
description: The python architecture.
default: "x64"
godot-ref:
description: The reference for the Godot engine repository.
default: master
godot-repository:
description: The Godot engine repository.
default: godotengine/godot
go-version:
description: The Go version to use.
default: "1.21"
runs:
using: "composite"
steps:
Expand All @@ -23,28 +32,21 @@ runs:
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python -m pip install scons==4.4.0
scons --version
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
target: x86_64-pc-windows-gnu
components: rustfmt, clippy

- name: Checkout modules repo
uses: actions/checkout@v3
with:
repository: v-sekai/godot-modules-groups
path: vsk_modules
submodules: recursive
ref: aa767c745f84f8b06f740a30cc51abd83ff21c49

- name: Checkout godot engine repo
uses: actions/checkout@v3
with:
repository: v-sekai/godot
repository: ${{ inputs.godot-repository }}
path: godot
ref: dfe91ac79cde65162296f80a1ad6036a9d7a5a20
ref: ${{ inputs.godot-ref }}

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ inputs.go-version }}

- name: Check Go version
shell: bash
run: go version
20 changes: 20 additions & 0 deletions .github/actions/vsk-generate-constants/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Generate build constants
description: Generate build constants
runs:
using: "composite"
steps:
- name: Generate build constants
shell: bash
run: |
export BUILD_LABEL="${{ github.repository }}/${{ github.sha }}"
export BUILD_DATE_STR="$(date --utc --iso=seconds)"
export BUILD_UNIX_TIME="$(date +%s)"
export BUILD_URL="${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
cat << EOF > addons/vsk_version/build_constants.gd
## AUTOGENERATED BY BUILD
const BUILD_LABEL = "$BUILD_LABEL"
const BUILD_DATE_STR = "$BUILD_DATE_STR"
const BUILD_UNIX_TIME = "$BUILD_UNIX_TIME"
const BUILD_URL = "$BUILD_URL"
EOF
cat addons/vsk_version/build_constants.gd
10 changes: 6 additions & 4 deletions .github/copyright_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
# Derived from:
# https://github.com/godotengine/godot/blob/4.0/misc/scripts/copyright_headers.py

import sys, os
import sys, os, re

header = """\
# Copyright (c) 2018-present. This file is part of V-Sekai https://v-sekai.org/.
# K. S. Ernest (Fire) Lee & Contributors
# Copyright (c) 2023-present. This file is part of V-Sekai https://v-sekai.org/.
# K. S. Ernest (Fire) Lee & Contributors (see .all-contributorsrc).
# $filename
# SPDX-License-Identifier: MIT
"""
Expand Down Expand Up @@ -73,7 +73,9 @@
while line.strip() == "": # Skip empty lines at the top
line = fileread.readline()

if line.find("# Copyright (c) 2018-present. This file is part of V-Sekai") == -1: # Header starts this way
match = re.search(r"# Copyright \(c\) \d{4}-present\. This file is part of V-Sekai", line)

if match is None:
# Maybe starting with a non-comment, abort header magic
header_done = True

Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
4 changes: 2 additions & 2 deletions .github/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ $# -eq 0 ]; then
# Loop through all code files tracked by Git.
files=$(git ls-files -- '*.gd' \
':!:.git/*' ':!:thirdparty/*' ':!:addons/vrm' ':!:addons/godot_state_charts' ':!:addons/xr_vignette' \
':!:addons/unidot_importer' ':!:addons/Godot-MToon-Shader' ':!:addons/gut' ':!:addons/smoothing' ':!:addons/gut' \
':!:addons/unidot_importer' ':!:addons/Godot-MToon-Shader' ':!:addons/gut' ':!:addons/smoothing' \
':!:.git/*' ':!:thirdparty/*' ':!:*/thirdparty/*' ':!:platform/android/java/lib/src/com/google/*' \
':!:*-so_wrap.*' ':!:tests/python_build/*')
else
Expand All @@ -55,7 +55,7 @@ for f in $files; do
continue
fi

python .github/copyright_headers.py "$f"
python3 .github/copyright_headers.py "$f"
done

diff=$(git diff --color)
Expand Down
Empty file modified .github/gd_format.sh
100755 → 100644
Empty file.
22 changes: 22 additions & 0 deletions .github/install_vulkan_sdk_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh

set -euo pipefail
IFS=$'\n\t'

# Download and install the Vulkan SDK.
curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg" -o /tmp/vulkan-sdk.dmg
hdiutil attach /tmp/vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan \
--accept-licenses --default-answer --confirm-command install

cnt=5
until hdiutil detach -force /Volumes/vulkan-sdk
do
[[ cnt -eq "0" ]] && break
sleep 1
((cnt--))
done

rm -f /tmp/vulkan-sdk.dmg

echo 'Vulkan SDK installed successfully! You can now build Godot by running "scons".'
1 change: 1 addition & 0 deletions .github/vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vscode
18 changes: 18 additions & 0 deletions .github/vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "Linux",
"includePath": ["${workspaceFolder}/**"],
"defines": ["_DEBUG", "UNICODE", "_UNICODE"],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"compileCommands": "${workspaceFolder}/godot/compile_commands.json",
"compilerArgs": [],
"browse": {
"path": ["${workspaceFolder}/**"]
}
}
],
"version": 4
}
23 changes: 23 additions & 0 deletions .github/vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"options": {
"env": {
"RUST_LOG": "error",
"MVSQLITE_DATA_PLANE": "http://192.168.0.39:7000"
}
},
"configurations": [
{
"name": "Build the editor",
"type": "lldb",
"request": "launch",
"args": ["--path", "v-sekai-game", "-e"],
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/vsk_godot/bin/godot.windows.editor.double.x86_64.llvm.exe",
"preLaunchTask": "Godot Engine"
}
]
}
Loading

0 comments on commit 53f3fe2

Please sign in to comment.