Added documentation generation in .gitlab-ci.yml
This commit is contained in:
@@ -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"
|
||||
link_type: "package"
|
||||
- name: "${PROJECT_NAME}_docs"
|
||||
url: "${CI_PROJECT_UR}L/-/jobs/${Docs_job_id}/artifacts/download"
|
||||
BIN
docs/docs/assets/logo.png
Normal file
BIN
docs/docs/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
3
docs/docs/index.md
Normal file
3
docs/docs/index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Home
|
||||
|
||||
An example README that you can replace with your own content!
|
||||
7
docs/docs/stylesheets/extra.css
Normal file
7
docs/docs/stylesheets/extra.css
Normal file
@@ -0,0 +1,7 @@
|
||||
:root {
|
||||
--md-primary-fg-color: #8191ff;
|
||||
}
|
||||
|
||||
.md-header {
|
||||
background-color: #232323;
|
||||
}
|
||||
37
docs/mkdocs.yml
Normal file
37
docs/mkdocs.yml
Normal file
@@ -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
|
||||
3
docs/requirements.txt
Normal file
3
docs/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
mkdocs==1.5.3
|
||||
mkdocs-material==9.5.12
|
||||
mike==2.0.0
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user