Skip to content

Commit

Permalink
chore: update template
Browse files Browse the repository at this point in the history
  • Loading branch information
jolexxa committed May 12, 2024
1 parent 830ded3 commit c3f6b38
Show file tree
Hide file tree
Showing 24 changed files with 293 additions and 439 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
46 changes: 42 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
14 changes: 10 additions & 4 deletions .github/workflows/auto_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
95 changes: 0 additions & 95 deletions .github/workflows/publish.yaml

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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}",
Expand All @@ -34,4 +34,4 @@
"stopAtEntry": false,
},
]
}
}
Loading

0 comments on commit c3f6b38

Please sign in to comment.