From c3f6b386c0b1bbfd72a3de9ad70c2b45a322934e Mon Sep 17 00:00:00 2001 From: Joanna May Date: Sun, 12 May 2024 18:45:06 -0500 Subject: [PATCH] chore: update template --- .editorconfig | 12 ++ .gitattributes | 46 ++++++- .github/workflows/auto_release.yaml | 14 ++- .github/workflows/publish.yaml | 95 -------------- .github/workflows/release.yaml | 99 +++++++++++++++ .github/workflows/tests.yaml | 9 +- .gitignore | 10 +- .vscode/launch.json | 10 +- .vscode/settings.json | 76 ++++++------ .vscode/tasks.json | 19 +-- Chickensoft.GodotPackage.Tests/.editorconfig | 8 ++ .../Chickensoft.GodotPackage.Tests.csproj | 30 +++-- .../badges/branch_coverage.svg | 116 +----------------- .../badges/line_coverage.svg | 116 +----------------- Chickensoft.GodotPackage.Tests/coverage.sh | 4 +- .../icon.svg.import | 2 +- Chickensoft.GodotPackage.Tests/nuget.config | 1 - Chickensoft.GodotPackage.Tests/project.godot | 2 +- Chickensoft.GodotPackage.Tests/test/Tests.cs | 6 +- .../Chickensoft.GodotPackage.csproj | 18 ++- Chickensoft.GodotPackage/icon.png | 4 +- README.md | 12 +- cspell.json | 21 +++- renovate.json | 2 +- 24 files changed, 293 insertions(+), 439 deletions(-) delete mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 Chickensoft.GodotPackage.Tests/.editorconfig diff --git a/.editorconfig b/.editorconfig index 4d59f45..a9e0a78 100644 --- a/.editorconfig +++ b/.editorconfig @@ -456,3 +456,15 @@ dotnet_diagnostic.RCS1161.severity = none dotnet_diagnostic.RCS1165.severity = none # Allow keyword-based names so that parameter names like `@event` can be used. dotnet_diagnostic.CA1716.severity = none +# Let me put comments where I like +dotnet_diagnostic.RCS1181.severity = none +# Allow me to use the word Collection if I want. +dotnet_diagnostic.CA1711.severity = none +# No primary constructors โ€” not supported well by tooling. +dotnet_diagnostic.IDE0290.severity = none +# Let me write dumb if statements for readability. +dotnet_diagnostic.IDE0046.severity = none +# Don't make me use expression bodies for methods +dotnet_diagnostic.IDE0022.severity = none +# Don't make me populate a switch expression redundantly +dotnet_diagnostic.IDE0072.severity = none diff --git a/.gitattributes b/.gitattributes index 9335e48..3b7ca90 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,46 @@ +# Normalize EOL for all files that Git considers text files. * text=auto eol=lf + +# Image formats *.bmp filter=lfs diff=lfs merge=lfs -text -*.dll filter=lfs diff=lfs merge=lfs -text -*.exe filter=lfs diff=lfs merge=lfs -text -*.ico filter=lfs diff=lfs merge=lfs -text -*.jpeg filter=lfs diff=lfs merge=lfs -text +*.dds filter=lfs diff=lfs merge=lfs -text +*.exr filter=lfs diff=lfs merge=lfs -text +*.hdr filter=lfs diff=lfs merge=lfs -text *.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text +*.tga filter=lfs diff=lfs merge=lfs -text +*.svg filter=lfs diff=lfs merge=lfs -text +*.webp filter=lfs diff=lfs merge=lfs -text + +# Audio and Video formats +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text +*.ogx filter=lfs diff=lfs merge=lfs -text +*.ogv filter=lfs diff=lfs merge=lfs -text + +# 3D formats +*.gltf filter=lfs diff=lfs merge=lfs -text +*.blend filter=lfs diff=lfs merge=lfs -text +*.blend1 filter=lfs diff=lfs merge=lfs -text +*.glb filter=lfs diff=lfs merge=lfs -text +*.dae filter=lfs diff=lfs merge=lfs -text +*.obj filter=lfs diff=lfs merge=lfs -text +*.fbx filter=lfs diff=lfs merge=lfs -text + +# Build +*.dll filter=lfs diff=lfs merge=lfs -text +*.exe filter=lfs diff=lfs merge=lfs -text +*.pdb filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.dylib filter=lfs diff=lfs merge=lfs -text + +# Packaging +*.zip filter=lfs diff=lfs merge=lfs -text +*.7z filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.file filter=lfs diff=lfs merge=lfs -text +*.dylib filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/auto_release.yaml b/.github/workflows/auto_release.yaml index a94ae9f..5209f30 100644 --- a/.github/workflows/auto_release.yaml +++ b/.github/workflows/auto_release.yaml @@ -14,7 +14,7 @@ # You can disable this action by setting the DISABLE_AUTO_RELEASE repository # variable to true. -name: ๐Ÿฆพ Auto-Release +name: '๐Ÿฆพ Auto-Release' on: workflow_run: workflows: ["๐Ÿšฅ Tests"] @@ -32,6 +32,11 @@ jobs: steps: - name: ๐Ÿงพ Checkout uses: actions/checkout@v4 + with: + # Use your GitHub Personal Access Token variable here. + token: ${{ secrets.GH_BASIC }} + lfs: true + submodules: 'recursive' - name: ๐Ÿง‘โ€๐Ÿ”ฌ Check Test Results id: tests @@ -43,7 +48,7 @@ jobs: run: | message=$(git log -1 --pretty=%B) - if [[ $message == *"chore(deps):"* ]]; then + if [[ $message == *"chore(deps)"* ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" else echo "changed=false" >> "$GITHUB_OUTPUT" @@ -65,11 +70,12 @@ jobs: echo "โœ‹ Not creating a release." fi - release: - uses: './.github/workflows/publish.yaml' + trigger_release: + uses: './.github/workflows/release.yaml' needs: auto_release if: needs.auto_release.outputs.should_release == 'true' secrets: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + GH_BASIC: ${{ secrets.GH_BASIC }} with: bump: patch diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index ccda269..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: '๐Ÿ“ฆ Publish' -on: - workflow_dispatch: - branches: - - main - inputs: - bump: - description: "Version Bump Method" - type: choice - options: - - major - - minor - - patch - required: true - workflow_call: - secrets: - NUGET_API_KEY: - description: "NuGet API Key" - required: true - inputs: - bump: - description: "Version Bump Method" - type: string - required: true - -jobs: - publish: - name: ๐Ÿ“ฆ Publish - runs-on: ubuntu-latest - steps: - - name: ๐Ÿงพ Checkout - uses: actions/checkout@v4 - with: - lfs: true - submodules: 'recursive' - - - name: ๐Ÿ”Ž Read Current Project Version - uses: KageKirin/get-csproj-version@v1.0.0 - id: current-version - with: - file: Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj - xpath: /Project/PropertyGroup/Version - - - name: ๐Ÿ–จ Print Current Version - run: | - echo "Current Version: ${{ steps.current-version.outputs.version }}" - - - name: ๐Ÿงฎ Compute Next Version - uses: chickensoft-games/next-godot-csproj-version@v1 - id: next-version - with: - project-version: ${{ steps.current-version.outputs.version }} - godot-version: global.json - bump: ${{ inputs.bump }} - - - name: โœจ Print Next Version - run: | - echo "Next Version: ${{ steps.next-version.outputs.version }}" - - - name: ๐Ÿ“ Change Version - uses: vers-one/dotnet-project-version-updater@v1.6 - with: - file: "Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj" - version: ${{ steps.next-version.outputs.version }} - - - name: โœ๏ธ Commit Changes - run: | - git config user.name "action@github.com" - git config user.email "GitHub Action" - git commit -a -m "chore(version): update version to ${{ steps.next-version.outputs.version }}" - git push - - - name: โœจ Create Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release create --generate-notes "v${{ steps.next-version.outputs.version }}" - - - name: ๐Ÿ’ฝ Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - # Use the .NET SDK from global.json in the root of the repository. - global-json-file: global.json - - - name: ๐Ÿ“ฆ Publish - run: | - # build the package - dotnet build Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj -c Release - - # find the built nuget package - nuget_package=$(find . -name "Chickensoft.GodotPackage.*.nupkg") - - echo "๐Ÿ“ฆ Publishing package: $nuget_package" - - # publish the nuget package - dotnet nuget push "$nuget_package" --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..696014a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,99 @@ +name: '๐Ÿ“ฆ Release' +on: + # Make a release whenever the developer wants. + workflow_dispatch: + inputs: + bump: + type: string + description: "major, minor, or patch" + required: true + default: "patch" + # Make a release whenever we're told to by another workflow. + workflow_call: + secrets: + NUGET_API_KEY: + description: "API key for Nuget" + required: true + GH_BASIC: + description: "Personal access token (PAT) for GitHub" + required: true + # Input unifies with the workflow dispatch since it's identical. + inputs: + bump: + type: string + description: "major, minor, or patch" + required: true + default: "patch" +jobs: + release: + name: '๐Ÿ“ฆ Release' + runs-on: ubuntu-latest + env: + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_NOLOGO: true + steps: + - name: ๐Ÿงพ Checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_BASIC }} + lfs: true + submodules: 'recursive' + fetch-depth: 0 # So we can get all tags. + + - name: ๐Ÿ”Ž Read Current Project Version + id: current-version + uses: WyriHaximus/github-action-get-previous-tag@v1 + with: + fallback: "0.0.0-devbuild" + + - name: ๐Ÿ–จ Print Current Version + run: | + echo "Current Version: ${{ steps.current-version.outputs.tag }}" + + - name: ๐Ÿงฎ Compute Next Version + uses: chickensoft-games/next-godot-csproj-version@v1 + id: next-version + with: + project-version: ${{ steps.current-version.outputs.tag }} + godot-version: global.json + bump: ${{ inputs.bump }} + + - uses: actions/setup-dotnet@v4 + name: ๐Ÿ’ฝ Setup .NET SDK + with: + # Use the .NET SDK from global.json in the root of the repository. + global-json-file: global.json + + # Write version to file so .NET will build correct version. + - name: ๐Ÿ“ Write Version to File + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "0.0.0-devbuild" + replace: ${{ steps.next-version.outputs.version }} + regex: false + include: Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj + + - name: ๐Ÿ“ฆ Build + run: dotnet build \ + Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj -c Release + + - name: ๐Ÿ”Ž Get Package Path + id: package-path + run: | + package=$(find ./Chickensoft.GodotPackage/nupkg -name "*.nupkg") + echo "package=$package" >> "$GITHUB_OUTPUT" + echo "๐Ÿ“ฆ Found package: $package" + + - name: โœจ Create Release + env: + GITHUB_TOKEN: ${{ secrets.GH_BASIC }} + run: | + version="${{ steps.next-version.outputs.version }}" + gh release create --title "v$version" --generate-notes "$version" \ + "${{ steps.package-path.outputs.package }}" + + - name: ๐Ÿ›œ Publish to Nuget + run: | + dotnet nuget push "${{ steps.package-path.outputs.package }}" \ + --api-key "${{ secrets.NUGET_API_KEY }}" \ + --source "https://api.nuget.org/v3/index.json" --skip-duplicate diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a585966..c19d907 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,6 +30,10 @@ jobs: steps: - name: ๐Ÿงพ Checkout uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_BASIC }} + lfs: true + submodules: 'recursive' - name: ๐Ÿ’ฝ Setup .NET SDK uses: actions/setup-dotnet@v4 @@ -52,11 +56,6 @@ jobs: # renovatebot updates the Godot SDK version. version: global.json - - name: ๐Ÿ”ฌ Verify Setup - run: | - dotnet --version - godot --version - - name: ๐Ÿง‘โ€๐Ÿ”ฌ Generate .NET Bindings working-directory: Chickensoft.GodotPackage.Tests run: godot --headless --build-solutions --quit || exit 0 diff --git a/.gitignore b/.gitignore index 0a83bda..377ed34 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ -Chickensoft.GodotPackage/nupkg/ - -Chickensoft.GodotPackage.Tests/coverage/* -!Chickensoft.GodotPackage.Tests/coverage/.gdignore - +**/coverage/* +!**/coverage/.gdignore +nupkg/ .godot/ bin/ obj/ .generated/ .vs/ .DS_Store +*.DotSettings.user +*.binlog diff --git a/.vscode/launch.json b/.vscode/launch.json index 7c986e8..554b6af 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,16 +1,16 @@ { "version": "0.2.0", "configurations": [ - // For these launch configurations to work, you need to setup a GODOT4 + // For these launch configurations to work, you need to setup a GODOT // environment variable. On mac or linux, this can be done by adding // the following to your .zshrc, .bashrc, or .bash_profile file: - // export GODOT4="/Applications/Godot.app/Contents/MacOS/Godot" + // export GODOT="/Applications/Godot.app/Contents/MacOS/Godot" { "name": "๐Ÿงช Debug Tests", "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${env:GODOT4}", + "program": "${env:GODOT}", "args": [ // These command line flags are used by GoDotTest to run tests. "--run-tests", @@ -24,7 +24,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${env:GODOT4}", + "program": "${env:GODOT}", "args": [ // These command line flags are used by GoDotTest to run tests. "--run-tests=${fileBasenameNoExtension}", @@ -34,4 +34,4 @@ "stopAtEntry": false, }, ] -} +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 24caebe..863b15d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,15 +1,20 @@ { "[csharp]": { "editor.codeActionsOnSave": { - "source.addMissingImports": true, - "source.fixAll": true, - "source.organizeImports": true + "source.addMissingImports": "explicit", + "source.fixAll": "explicit", + "source.organizeImports": "explicit" }, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": false }, "csharp.semanticHighlighting.enabled": true, + "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true, + // Required to keep the C# language server from getting confused about which + // solution to open. + "dotnet.defaultSolution": "Chickensoft.Godotpackage.sln", + "dotnet.server.useOmnisharp": false, "editor.semanticHighlighting.enabled": true, // C# doc comment colorization gets lost with semantic highlighting, but we // need semantic highlighting for proper syntax highlighting with record @@ -18,60 +23,64 @@ // Here's a workaround for doc comment highlighting from // https://github.com/OmniSharp/omnisharp-vscode/issues/3816 "editor.tokenColorCustomizations": { - "[*Dark*]": { - // Themes that include the word "Dark" in them. + "[*]": { + // Themes that don't include the word "Dark" or "Light" in them. + // These are some bold colors that show up well against most dark and + // light themes. + // + // Change them to something that goes well with your preferred theme :) "textMateRules": [ { "scope": "comment.documentation", "settings": { - "foreground": "#608B4E" + "foreground": "#0091ff" } }, { "scope": "comment.documentation.attribute", "settings": { - "foreground": "#C8C8C8" + "foreground": "#8480ff" } }, { "scope": "comment.documentation.cdata", "settings": { - "foreground": "#E9D585" + "foreground": "#0091ff" } }, { "scope": "comment.documentation.delimiter", "settings": { - "foreground": "#808080" + "foreground": "#aa00ff" } }, { "scope": "comment.documentation.name", "settings": { - "foreground": "#569CD6" + "foreground": "#ef0074" } } ] }, - "[*Light*]": { - // Themes that include the word "Light" in them. + "[*Dark*]": { + // Themes that include the word "Dark" in them. "textMateRules": [ { "scope": "comment.documentation", "settings": { - "foreground": "#008000" + "foreground": "#608B4E" } }, { "scope": "comment.documentation.attribute", "settings": { - "foreground": "#282828" + "foreground": "#C8C8C8" } }, { "scope": "comment.documentation.cdata", "settings": { - "foreground": "#808080" + "foreground": "#E9D585" } }, { @@ -83,64 +92,58 @@ { "scope": "comment.documentation.name", "settings": { - "foreground": "#808080" + "foreground": "#569CD6" } } ] }, - "[*]": { - // Themes that don't include the word "Dark" or "Light" in them. - // These are some bold colors that show up well against most dark and - // light themes. - // - // Change them to something that goes well with your preferred theme :) + "[*Light*]": { + // Themes that include the word "Light" in them. "textMateRules": [ { "scope": "comment.documentation", "settings": { - "foreground": "#0091ff" + "foreground": "#008000" } }, { "scope": "comment.documentation.attribute", "settings": { - "foreground": "#8480ff" + "foreground": "#282828" } }, { "scope": "comment.documentation.cdata", "settings": { - "foreground": "#0091ff" + "foreground": "#808080" } }, { "scope": "comment.documentation.delimiter", "settings": { - "foreground": "#aa00ff" + "foreground": "#808080" } }, { "scope": "comment.documentation.name", "settings": { - "foreground": "#ef0074" + "foreground": "#808080" } } ] } }, "markdownlint.config": { - // Allow html in markdown. - "MD033": false, // Allow non-unique heading names so we don't break the changelog. - "MD024": false + "MD024": false, + // Allow html in markdown. + "MD033": false }, - "markdownlint.ignore": [ - "**/LICENSE" + "markdownlint.lintWorkspaceGlobs": [ + "!**/LICENSE" ], "omnisharp.enableEditorConfigSupport": true, - "omnisharp.enableImportCompletion": true, "omnisharp.enableMsBuildLoadProjectsOnDemand": false, - "omnisharp.enableRoslynAnalyzers": true, "omnisharp.maxFindSymbolsItems": 3000, "omnisharp.organizeImportsOnFormat": true, "omnisharp.useModernNet": true, @@ -162,6 +165,5 @@ "icon": "terminal-powershell", "source": "PowerShell" } - }, - "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true -} + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4ce799c..2bfa1a5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -36,22 +36,5 @@ "clear": true }, }, - { - "label": "build-solutions", - "group": "test", - "command": "dotnet restore; ${env:GODOT4} --headless --build-solutions --quit || exit 0", - "type": "shell", - "options": { - "cwd": "${workspaceFolder}/Chickensoft.GodotPackage.Tests" - }, - "presentation": { - "echo": true, - "reveal": "silent", - "focus": false, - "panel": "shared", - "showReuseMessage": false, - "clear": false - } - }, ] -} +} \ No newline at end of file diff --git a/Chickensoft.GodotPackage.Tests/.editorconfig b/Chickensoft.GodotPackage.Tests/.editorconfig new file mode 100644 index 0000000..9ea24c1 --- /dev/null +++ b/Chickensoft.GodotPackage.Tests/.editorconfig @@ -0,0 +1,8 @@ +# EditorConfig for the test project. + +root = false + +[*.{cs,csx,cake}] + +# Not disposing of objects in a test is normal within Godot +dotnet_diagnostic.CA1001.severity = none diff --git a/Chickensoft.GodotPackage.Tests/Chickensoft.GodotPackage.Tests.csproj b/Chickensoft.GodotPackage.Tests/Chickensoft.GodotPackage.Tests.csproj index 0f892f0..313b635 100644 --- a/Chickensoft.GodotPackage.Tests/Chickensoft.GodotPackage.Tests.csproj +++ b/Chickensoft.GodotPackage.Tests/Chickensoft.GodotPackage.Tests.csproj @@ -1,31 +1,35 @@ - net6.0 - true - 10.0 + net8.0 + disable enable + true + preview Chickensoft.GodotPackage.Tests + full + true + true + - - full - true + .generated + + - + - + - + + + + diff --git a/Chickensoft.GodotPackage.Tests/badges/branch_coverage.svg b/Chickensoft.GodotPackage.Tests/badges/branch_coverage.svg index 069c951..59fe577 100644 --- a/Chickensoft.GodotPackage.Tests/badges/branch_coverage.svg +++ b/Chickensoft.GodotPackage.Tests/badges/branch_coverage.svg @@ -1,113 +1,3 @@ - - - Code coverage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Generated by: ReportGenerator 5.1.17.0 - - - - Coverage - Coverage - - N/AN/A - - - - - - Branch coverage - - - \ No newline at end of file +version https://git-lfs.github.com/spec/v1 +oid sha256:00cc2caa8fb868a3395270b25cd9f802c75e8110bbc08542edc1d97014e403aa +size 7386 diff --git a/Chickensoft.GodotPackage.Tests/badges/line_coverage.svg b/Chickensoft.GodotPackage.Tests/badges/line_coverage.svg index fcdc4e5..c2cc7ce 100644 --- a/Chickensoft.GodotPackage.Tests/badges/line_coverage.svg +++ b/Chickensoft.GodotPackage.Tests/badges/line_coverage.svg @@ -1,113 +1,3 @@ - - - Code coverage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Generated by: ReportGenerator 5.1.17.0 - - - - Coverage - Coverage - 100%100% - - - - - - Line coverage - - - - \ No newline at end of file +version https://git-lfs.github.com/spec/v1 +oid sha256:b5770c82fa07a9f273c9e27a171fa96075709de25820e6b636918206b5cb465c +size 5161 diff --git a/Chickensoft.GodotPackage.Tests/coverage.sh b/Chickensoft.GodotPackage.Tests/coverage.sh index d1176d3..4087d52 100755 --- a/Chickensoft.GodotPackage.Tests/coverage.sh +++ b/Chickensoft.GodotPackage.Tests/coverage.sh @@ -2,7 +2,7 @@ # To collect code coverage, you will need the following environment setup: # -# - A "GODOT4" environment variable pointing to the Godot executable +# - A "GODOT" environment variable pointing to the Godot executable # - ReportGenerator installed # # dotnet tool install -g dotnet-reportgenerator-globaltool @@ -26,7 +26,7 @@ dotnet build --no-restore coverlet \ "./.godot/mono/temp/bin/Debug" --verbosity detailed \ - --target $GODOT4 \ + --target $GODOT \ --targetargs "--run-tests --coverage --quit-on-finish" \ --format "opencover" \ --output "./coverage/coverage.xml" \ diff --git a/Chickensoft.GodotPackage.Tests/icon.svg.import b/Chickensoft.GodotPackage.Tests/icon.svg.import index 7cc0431..e8dbc89 100644 --- a/Chickensoft.GodotPackage.Tests/icon.svg.import +++ b/Chickensoft.GodotPackage.Tests/icon.svg.import @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.cte [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 -compress/bptc_ldr=0 compress/normal_map=0 compress/channel_pack=0 mipmaps/generate=false diff --git a/Chickensoft.GodotPackage.Tests/nuget.config b/Chickensoft.GodotPackage.Tests/nuget.config index 27ed8a9..f498747 100644 --- a/Chickensoft.GodotPackage.Tests/nuget.config +++ b/Chickensoft.GodotPackage.Tests/nuget.config @@ -2,7 +2,6 @@ - diff --git a/Chickensoft.GodotPackage.Tests/project.godot b/Chickensoft.GodotPackage.Tests/project.godot index e4efa77..2a592de 100644 --- a/Chickensoft.GodotPackage.Tests/project.godot +++ b/Chickensoft.GodotPackage.Tests/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="Chickensoft.GodotPackage.Tests" run/main_scene="res://test/Tests.tscn" -config/features=PackedStringArray("4.0", "C#", "Mobile") +config/features=PackedStringArray("4.2", "C#", "Mobile") config/icon="res://icon.svg" [dotnet] diff --git a/Chickensoft.GodotPackage.Tests/test/Tests.cs b/Chickensoft.GodotPackage.Tests/test/Tests.cs index e9808ad..ac16b84 100644 --- a/Chickensoft.GodotPackage.Tests/test/Tests.cs +++ b/Chickensoft.GodotPackage.Tests/test/Tests.cs @@ -5,6 +5,8 @@ namespace Chickensoft.GodotPackage.Tests; using Chickensoft.GoDotTest; public partial class Tests : Node2D { - public override void _Ready() - => _ = GoTest.RunTests(Assembly.GetExecutingAssembly(), this); + public override void _Ready() => CallDeferred(MethodName.RunTests); + + public void RunTests() => + GoTest.RunTests(Assembly.GetExecutingAssembly(), this); } diff --git a/Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj b/Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj index 4b0d073..63844c7 100644 --- a/Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj +++ b/Chickensoft.GodotPackage/Chickensoft.GodotPackage.csproj @@ -1,21 +1,21 @@ - net6.0 + net8.0 true preview true + true enable true Chickensoft.GodotPackage true ./nupkg portable - true Chickensoft.GodotPackage - 1.0.0 - - ยฉ 2023 Your Name + 0.0.0-devbuild + Chickensoft.GodotPackage description. + ยฉ 2024 Your Name Your Name Your Name @@ -39,6 +39,14 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/Chickensoft.GodotPackage/icon.png b/Chickensoft.GodotPackage/icon.png index 827d392..14fe28c 100644 --- a/Chickensoft.GodotPackage/icon.png +++ b/Chickensoft.GodotPackage/icon.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3aa32156537e31291443266a14f0b9f18138ba06c878c29374f31ed913392de3 -size 40050 +oid sha256:50b84ea56c8f198dc767bf9338c49f696de64824318836ca4a5ab88a80b35540 +size 113608 diff --git a/README.md b/README.md index 1d5f7b4..3df7df2 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ dotnet new chickenpackage --name "MyPackageName" --param:author "My Name" # Use Godot to generate files needed to compile the package's test project. cd MyPackageName/MyPackageName.Tests/ -godot4 --headless --build-solutions --quit +$GODOT --headless --build-solutions --quit dotnet build ``` @@ -53,7 +53,7 @@ You can debug the included test project for your package in `Chickensoft.GodotPa The launch profiles will trigger a build (without restoring packages) and then instruct .NET to run Godot 4 (while communicating with VSCode for interactive debugging). -> **Important:** You must setup a `GODOT4` environment variable for the launch configurations above. If you haven't done so already, please see the [Chickensoft Setup Docs][setup-docs]. +> **Important:** You must setup a `GODOT` environment variable for the launch configurations above. If you're using [GodotEnv] to install and manage Godot versions, you're already setup! For more info, see the [Chickensoft Setup Docs][setup-docs]. ## ๐Ÿ‘ท Testing @@ -72,8 +72,6 @@ Please see `test/ExampleTest.cs` and the [GoDotTest] readme for more examples. Code coverage requires a few `dotnet` global tools to be installed first. You should install these tools from the root of the project directory. -The `nuget.config` file in the root of the project allows the correct version of `coverlet` to be installed from the coverlet nightly distributions. Overriding the coverlet version will be required [until coverlet releases a stable version with the fixes that allow it to work with Godot 4][coverlet-issues]. - ```sh dotnet tool install --global coverlet.console dotnet tool update --global coverlet.console @@ -118,9 +116,9 @@ You can also words to the local `cspell.json` file from VSCode by hovering over ![Fix Spelling](docs/spelling_fix.png) -### ๐Ÿ“ฆ Publish +### ๐Ÿ“ฆ Release -The included workflow in [`.github/workflows/publish.yaml`](.github/workflows/publish.yaml) can be manually dispatched when you're ready to publish your package to Nuget. +The included workflow in [`.github/workflows/release.yaml`](.github/workflows/publish.yaml) can be manually dispatched when you're ready to make a new release. Once you specify `major`, `minor`, or `patch` for the version bump strategy, the workflow will build your package with the updated version and release it on both GitHub and nuget. The accompanying [`.github/workflows/auto_release.yaml`](.github/workflows/auto_release.yaml) will trigger the publish workflow if it detects a new commit in main that is a routine dependency update from renovatebot. Since Renovatebot is configured to auto-merge dependency updates, your package will automatically be published to Nuget when a new version of Godot.NET.Sdk is released or other packages you depend on are updated. If this behavior is undesired, remove the `"automerge": true` property from [`renovate.json`](./renovate.json). @@ -161,4 +159,4 @@ If your project is setup to require approvals before pull requests can be merged [renovate-approve]: https://github.com/apps/renovate-approve [renovate-approve-2]: https://github.com/apps/renovate-approve-2 [about-renovate-approvals]: https://stackoverflow.com/a/66575885 -[coverlet-issues]: https://github.com/coverlet-coverage/coverlet/issues/1422 +[GodotEnv]: https://github.com/chickensoft-games/GodotEnv diff --git a/cspell.json b/cspell.json index 7997be2..2283c7b 100644 --- a/cspell.json +++ b/cspell.json @@ -5,35 +5,43 @@ "ignorePaths": [ "**/*.tscn", "**/*.import", - "Chickensoft.GodotPackage.Tests/badges/**/*.*", - "Chickensoft.GodotPackage.Tests/coverage/**/*.*", - "Chickensoft.GodotPackage.Tests/.godot/**/*.*", + "**/badges/**/*.*", + "**/coverage/**/*.*", + "**/.godot/**/*.*", "**/obj/**/*.*", "**/bin/**/*.*", - "Chickensoft.GodotPackage/nupkg/**/*.*" + "**/nupkg/**/*.*" ], "words": [ "assemblyfilters", "automerge", "branchcoverage", "brandedoutcast", + "buildtransitive", "camelcase", "chickenpackage", "Chickensoft", "classfilters", + "contentfiles", "CYGWIN", + "devbuild", "endregion", + "Finalizer", + "Finalizers", "globaltool", "godotengine", "godotpackage", "issuecomment", + "justalemon", "lcov", + "lihop", "linecoverage", "methodcoverage", "missingall", "msbuild", "MSYS", "nameof", + "Nerdbank", "netstandard", "NOLOGO", "nupkg", @@ -42,6 +50,8 @@ "OPTOUT", "paramref", "pascalcase", + "Postinitialize", + "Predelete", "renovatebot", "reportgenerator", "reporttypes", @@ -54,6 +64,7 @@ "typeparam", "typeparamref", "ulong", + "Unparented", "Xunit" ] -} +} \ No newline at end of file diff --git a/renovate.json b/renovate.json index c1cf6af..6e2564c 100644 --- a/renovate.json +++ b/renovate.json @@ -35,4 +35,4 @@ "allowedVersions": "/^(\\d+\\.\\d+\\.\\d+)(-godot(\\d+\\.)+\\d+(-.*)?)?$/" } ] -} +} \ No newline at end of file