Skip to content

sync #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

sync #75

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
root = true

###############################
# Core EditorConfig Options #
###############################

# All files
[*]
indent_style = space
charset = utf-8

[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,proto,json}]
indent_size = 2

[*.cs]
indent_size = 4
dotnet_sort_system_directives_first = true

# Wrapping preferences
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true

# ReSharper properties
resharper_csharp_wrap_lines = false
resharper_csharp_space_before_trailing_comment = true
resharper_csharp_space_after_operator_keyword = true
50 changes: 0 additions & 50 deletions .gitattributes

This file was deleted.

3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: ikpil
37 changes: 37 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
template: |
# What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION

categories:
- title: 'Changes'
labels:
- 'feature'
- 'feat'

- title: 'Bug Fixes'
labels:
- 'bug'
- 'fix'

version-resolver:
major:
labels:
- 'type: breaking'
minor:
labels:
- 'type: feature'
patch:
labels:
- 'type: bug'
- 'type: maintenance'
- 'type: docs'
- 'type: dependencies'
- 'type: security'

exclude-labels:
- 'skip-changelog'
88 changes: 88 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '17 1 * * 1'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Check out
uses: actions/checkout@v4

- name: Set up .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-extended
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
57 changes: 39 additions & 18 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,47 @@ name: .NET

on:
push:
branches: [ "main" ]
branches:
- 'main'
- 'pr/**'
paths:
- '**.cs'
- '**.csproj'
- '**.sln'
- '**.yml'
pull_request:
branches: [ "main" ]
branches:
- 'pr/**'
paths:
- '**.cs'
- '**.csproj'
- '**.sln'
- '**.yml'

jobs:
build:

runs-on: ubuntu-latest
build-and-test:
name: test-${{matrix.os}}-${{matrix.dotnet-version}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet-version: [ '6', '7', '8' ]
os: [ windows-latest, ubuntu-latest, macos-latest ]

steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore --framework net${{ matrix.dotnet-version }}.0

- name: Test
run: dotnet test -c Release --no-build --verbosity normal --framework net${{ matrix.dotnet-version }}.0
55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Nuget Publish

on:
workflow_dispatch:
inputs:
version:
description: version
required: true
type: string

jobs:
publish-to-nuget:
runs-on: ubuntu-latest
steps:
- name: version pattern
id: check-version
run: |
version="${{ github.event.inputs.version }}"
if [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Input matches pattern: $version"
else
echo "Input does not match pattern: $version"
exit 1
fi

- name: version check
if: success()
run: echo ok

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- name: restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore

- name: Test
run: dotnet test -c Release --no-build --verbosity normal

- name: Pack
run: dotnet pack -p:PackageVersion=${{ github.event.inputs.version }} -c Release --nologo --output working-nuget

- name: Publish the package to nuget.org
run: dotnet nuget push ./working-nuget/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- name: restore dependencies
run: dotnet restore

- name: build
run: dotnet build -c Release --no-restore

- name: publish
run: dotnet publish src/DotRecast.Recast.Demo -c Release --framework net8.0 --no-restore --no-self-contained --output working-temp

- name: version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag}
major=${version%%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT

- name: Zip
working-directory: ${{ env.working-directory }}
run: |
cp -rfv resources working-temp
cd working-temp
echo "dotnet DotRecast.Recast.Demo.dll" > run.bat
zip -r ../DotRecast.Recast.Demo-${{ steps.version.outputs.version}}.zip ./
if: success()

- uses: release-drafter/release-drafter@master
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: zip Upload
uses: softprops/action-gh-release@v1
with:
files: |
DotRecast.Recast.Demo-${{ steps.version.outputs.version}}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


Loading