diff --git a/.github/other/licenserc.yml b/.github/other/licenserc.yml new file mode 100644 index 0000000..1ecd9e5 --- /dev/null +++ b/.github/other/licenserc.yml @@ -0,0 +1,30 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +# File format: see https://github.com/apache/skywalking-eyes/blob/main/test/testdata/.licenserc_language_config_test.yaml + +header: + license: + spdx-id: MPL-2.0 + + paths: + - '**/*.rs' + - '**/*.gd' + - '**/*.sh' + - '**/*.md' + - '.github/**/*.yml' + + paths-ignore: + - 'ReadMe.md' + - '.github/ISSUE_TEMPLATE' + + comment: on-failure + + language: + GDScript: + extensions: ['.gd', '.sh'] + comment_style_id: 'Hashtag' + Rust: + extensions: ['.rs'] + comment_style_id: 'SlashAsterisk' diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d4793e2..09ef4a3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,8 +1,13 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + name: "Deploy to GitHub Pages" on: push: branches: [master] + pull_request: env: # Use fixed versions for now, replace with 'latest' to auto-use latest @@ -14,12 +19,13 @@ env: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: read +# contents: read + contents: write pages: write id-token: write jobs: - build-and-deploy: + build: runs-on: ubuntu-latest steps: @@ -48,9 +54,37 @@ jobs: run: mdbook build - name: "Upload Pages artifact" + if: github.ref == 'refs/heads/master' uses: actions/upload-pages-artifact@v1 with: path: book - name: "Deploy to GitHub Pages" + if: github.ref == 'refs/heads/master' uses: actions/deploy-pages@v2 + + + license-guard: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - name: "Check license headers" + uses: apache/skywalking-eyes/header@v0.5.0 + with: + # log: debug # optional: set the log level. The default value is `info`. + config: .github/other/licenserc.yml + # token: # optional: the token that license eye uses when it needs to comment on the pull request. + # Set to empty ("") to disable commenting on pull request. The default value is ${{ github.token }} + # mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`. + mode: check +# mode: fix + +# - name: "Commit changes" +# uses: EndBug/add-and-commit@v9 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# author_name: 'Godot-Rust Automation' +# author_email: 'actions@github.com' +# message: 'Auto-apply license headers' \ No newline at end of file diff --git a/book.toml b/book.toml index 0ea5823..3350102 100644 --- a/book.toml +++ b/book.toml @@ -1,3 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + [book] authors = ["The godot-rust developers"] multilingual = false diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 0533dd9..9888992 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -1,3 +1,9 @@ + + # Summary - [Introduction](index.md) diff --git a/src/contribute/conventions.md b/src/contribute/conventions.md index 8d472ec..612fc8a 100644 --- a/src/contribute/conventions.md +++ b/src/contribute/conventions.md @@ -1,3 +1,9 @@ + + # Code and API conventions diff --git a/src/contribute/dev-tools.md b/src/contribute/dev-tools.md index 37d75b0..1d4d215 100644 --- a/src/contribute/dev-tools.md +++ b/src/contribute/dev-tools.md @@ -1,3 +1,8 @@ + # Dev tools and testing diff --git a/src/contribute/index.md b/src/contribute/index.md index 71c9070..cb44276 100644 --- a/src/contribute/index.md +++ b/src/contribute/index.md @@ -1,3 +1,9 @@ + + # Contributing to gdext This chapter provides deeper information for people who are interested in contributing to the library. diff --git a/src/index.md b/src/index.md index ebf2ba5..8b1ee72 100644 --- a/src/index.md +++ b/src/index.md @@ -1,3 +1,9 @@ + + # Introduction Welcome to the **godot-rust book**! This is a work-in-progress user guide for **gdext**, the Rust binding for Godot 4. diff --git a/src/intro/hello-world.md b/src/intro/hello-world.md index 6405210..6043818 100644 --- a/src/intro/hello-world.md +++ b/src/intro/hello-world.md @@ -1,3 +1,9 @@ + + # Hello World This page shows you how to develop your own small extension library and load it from Godot. diff --git a/src/intro/index.md b/src/intro/index.md index b0bf866..53f7b06 100644 --- a/src/intro/index.md +++ b/src/intro/index.md @@ -1,3 +1,9 @@ + + # Getting Started This chapter guides you through the process of setting up **gdext** and developing your first application with it. diff --git a/src/intro/objects.md b/src/intro/objects.md index ede0232..5584826 100644 --- a/src/intro/objects.md +++ b/src/intro/objects.md @@ -1,3 +1,9 @@ + + # Managing objects in Rust This chapter covers the most central mechanism of the Rust bindings -- one that will accompany you from the Hello-World diff --git a/src/intro/setup.md b/src/intro/setup.md index 2046420..853931f 100644 --- a/src/intro/setup.md +++ b/src/intro/setup.md @@ -1,3 +1,9 @@ + + # Setup To use gdext, we need a few technologies. diff --git a/src/toolchain/compatibility.md b/src/toolchain/compatibility.md index b19a4fb..919c338 100644 --- a/src/toolchain/compatibility.md +++ b/src/toolchain/compatibility.md @@ -1,3 +1,9 @@ + + # Compatibility and stability The gdext library supports all stable Godot releases starting from Godot 4.0. diff --git a/src/toolchain/debugging.md b/src/toolchain/debugging.md index bcf4af1..0b93df7 100644 --- a/src/toolchain/debugging.md +++ b/src/toolchain/debugging.md @@ -1,3 +1,9 @@ + + # Debugging Extensions written in gdext can be debugged using LLDB, in a similar manner to other Rust programs. The primary difference is that LLDB will diff --git a/src/toolchain/godot-version.md b/src/toolchain/godot-version.md index 0ea66bb..8d24c5f 100644 --- a/src/toolchain/godot-version.md +++ b/src/toolchain/godot-version.md @@ -1,3 +1,9 @@ + + # Selecting a Godot version By default, `gdext` uses the latest stable release of Godot. This is desired in most cases, but it means that you cannot run your extension in diff --git a/src/toolchain/index.md b/src/toolchain/index.md index 604eec6..21812d0 100644 --- a/src/toolchain/index.md +++ b/src/toolchain/index.md @@ -1,3 +1,9 @@ + + # Toolchain Beyond Rust, there are quite a few things that are handy to know when working with Godot. This chapter goes into more detail