diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cd4afc5..ea952c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,24 @@ variables: GIT_SUBMODULE_STRATEGY: recursive + PROJECT_NAME: ${CI_PROJECT_NAME} + VERSION: "0.1" + stages: - build - release - + .build: stage: build when: manual script: - cmake . --preset ${SYSTEM}-${ARCHITECTURE}-Release - cmake --build --preset ${SYSTEM}-${ARCHITECTURE}-Release - - cp out/build/${SYSTEM}-${ARCHITECTURE}-Release/${CI_PROJECT_NAME}.${ARCHITECTURE}${SHARED_LIB_SUFFIX} ./ + - cp out/build/${SYSTEM}-${ARCHITECTURE}-Release/${PROJECT_NAME}.${ARCHITECTURE}${SHARED_LIB_SUFFIX} ./ artifacts: - name: ${CI_PROJECT_NAME} + name: ${PROJECT_NAME} paths: - - ${CI_PROJECT_NAME}.${ARCHITECTURE}${SHARED_LIB_SUFFIX} + - ${PROJECT_NAME}.${ARCHITECTURE}${SHARED_LIB_SUFFIX} expire_in: never reports: dotenv: job.env @@ -61,33 +64,81 @@ build:linux: parallel: matrix: - ARCHITECTURE: [x64, arm, arm64] - + +build:docs: + stage: build + image: "python:3.9-alpine" + when: manual + before_script: + - apk add git + - git clone https://gitlab.com/GothicMultiplayerTeam/docsgenerator.git + script: + - pip install mkdocs==1.5.3 + - pip install mkdocs-material==9.5.12 + - pip install Jinja2==3.1.3 + - python docsgenerator/generate.py ${VERSION} src --builddir "docs/docs/script-reference" --markdown + artifacts: + paths: + - docs/docs/script-reference/ + +pages: + stage: build + image: "python:3.9-alpine" + needs: [build:docs] + script: + - cd docs + - pip install -r requirements.txt + - mkdocs build -d "../public" + after_script: + - 'echo "Online documentation available under: ${CI_PAGES_URL}"' + artifacts: + paths: + - public + +docs: + stage: build + image: "python:3.9-alpine" + needs: [build:docs] + script: + - cd docs + - pip install -r requirements.txt + - mkdocs build -d "../${PROJECT_NAME}_docs" --no-directory-urls + after_script: + - echo "Docs_job_id=${CI_JOB_ID}" >> job.env + artifacts: + name: "${PROJECT_NAME}_docs" + paths: + - ${PROJECT_NAME}_docs + expire_in: never + reports: + dotenv: job.env + release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest when: manual - needs: [build:linux, build:windows] - variables: - TAG: '0.1' + needs: [build:windows, build:linux, pages, docs] script: - - echo "Create Release $TAG" + - echo "Created ${VERSION} release" release: - tag_name: '$TAG' + tag_name: "${VERSION}" description: "./CHANGELOG.md" assets: links: - - name: "${CI_PROJECT_NAME}.x86.dll" + - name: "${PROJECT_NAME}.x86.dll" url: "${CI_PROJECT_URL}/-/jobs/${Windows_x86_job_id}/artifacts/download" link_type: "package" - - name: "${CI_PROJECT_NAME}.x64.dll" + - name: "${PROJECT_NAME}.x64.dll" url: "${CI_PROJECT_URL}/-/jobs/${Windows_x64_job_id}/artifacts/download" link_type: "package" - - name: "${CI_PROJECT_NAME}.x64.so" + - name: "${PROJECT_NAME}.x64.so" url: "${CI_PROJECT_URL}/-/jobs/${Linux_x64_job_id}/artifacts/download" link_type: "package" - - name: "${CI_PROJECT_NAME}.arm.so" + - name: "${PROJECT_NAME}.arm.so" url: "${CI_PROJECT_URL}/-/jobs/${Linux_arm_job_id}/artifacts/download" link_type: "package" - - name: "${CI_PROJECT_NAME}.arm64.so" + - name: "${PROJECT_NAME}.arm64.so" url: "${CI_PROJECT_URL}/-/jobs/${Linux_arm64_job_id}/artifacts/download" - link_type: "package" \ No newline at end of file + link_type: "package" + - name: "${PROJECT_NAME}_docs" + url: "${CI_PROJECT_UR}L/-/jobs/${Docs_job_id}/artifacts/download" \ No newline at end of file diff --git a/docs/docs/assets/logo.png b/docs/docs/assets/logo.png new file mode 100644 index 0000000..b1a7447 Binary files /dev/null and b/docs/docs/assets/logo.png differ diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100644 index 0000000..1ab2f5c --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,3 @@ +# Home + +An example README that you can replace with your own content! \ No newline at end of file diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css new file mode 100644 index 0000000..492b119 --- /dev/null +++ b/docs/docs/stylesheets/extra.css @@ -0,0 +1,7 @@ +:root { + --md-primary-fg-color: #8191ff; +} + +.md-header { + background-color: #232323; +} \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000..298a997 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,37 @@ +site_name: Squirrel Template Module - Docs +repo_url: https://gitlab.com/GothicMultiplayerTeam/modules/squirrel-template +repo_name: Squirrel Template Module +edit_uri: "" +site_dir: "public" + +extra_css: + - stylesheets/extra.css + +extra: + version: + provider: mike + +markdown_extensions: + - admonition + - attr_list + - pymdownx.tabbed + - pymdownx.highlight + - pymdownx.superfences + +theme: + name: material + logo: assets/logo.png + icon: + repo: fontawesome/brands/gitlab + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/eye-outline + name: Switch to dark mode + + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/eye + name: Switch to light mode diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..01b75d6 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +mkdocs==1.5.3 +mkdocs-material==9.5.12 +mike==2.0.0 \ No newline at end of file diff --git a/src/sqmain.cpp b/src/sqmain.cpp index bbae691..47d8d8b 100644 --- a/src/sqmain.cpp +++ b/src/sqmain.cpp @@ -1,5 +1,17 @@ #include "sqapi.h" +/* squirreldoc (func) +* +* This is an entry point for the module. +* +* @version 0.1 +* @side shared +* @name sqmodule_load +* @param (HSQUIRRELVM) vm the squirrel vm. +* @param (HSQAPI) api the api ptr containing all of the squirrel functions. +* @return (int) returns a function status. +* +*/ extern "C" SQRESULT SQRAT_API sqmodule_load(HSQUIRRELVM vm, HSQAPI api) { SqModule::Initialize(vm, api);