Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,17 @@ indent_size = 2
[*.json]
indent_size = 2

# C# settings
[*.cs]
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_namespace_declarations = file_scoped:error
csharp_new_line_before_open_brace = types,methods,properties,anonymous_methods,control_blocks,anonymous_types,object_collection_array_initializers,lambdas

# Verify settings
[*.{received,verified}.{json,txt,xml}]
charset = "utf-8-bom"
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
147 changes: 84 additions & 63 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
# Auto detect text files and perform LF normalization
* text=auto

*.cs text diff=csharp
*.cshtml text diff=html
*.csx text diff=csharp
*.sln text eol=crlf
*.csproj text eol=crlf

###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just comment the entries below and
# uncomment the group further below
###############################################################################

*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wwaproj text eol=crlf

*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf


#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

#*.xproj merge=binary
#*.props merge=binary
#*.filters merge=binary
#*.vcxitems merge=binary

# Common settings that generally should always be used with your language specific settings

# Auto detect text files and perform LF normalization
Expand Down Expand Up @@ -144,3 +81,87 @@
.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore

# Auto detect text files and perform LF normalization
* text=auto

*.cs text diff=csharp
*.cshtml text diff=html
*.csx text diff=csharp
*.sln text eol=crlf
*.csproj text eol=crlf

# Apply override to all files in the directory
*.md linguist-detectable

###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just comment the entries below and
# uncomment the group further below
###############################################################################

*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wwaproj text eol=crlf

*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf


#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

#*.xproj merge=binary
#*.props merge=binary
#*.filters merge=binary
#*.vcxitems merge=binary

# Basic .gitattributes for a PowerShell repo.

# Source files
# ============
*.ps1 text eol=crlf
*.ps1x text eol=crlf
*.psm1 text eol=crlf
*.psd1 text eol=crlf
*.ps1xml text eol=crlf
*.pssc text eol=crlf
*.psrc text eol=crlf
*.cdxml text eol=crlf

# Verify
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
51 changes: 51 additions & 0 deletions .github/workflows/_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI/CD
env: { DOTNET_NOLOGO: true }
on:
workflow_call:
inputs:
test: { type: boolean, default: false, description: Run tests. }
publish: { type: boolean, default: false, description: Publish to nuget. Will run all tests too. }
secrets:
nuget-key:
jobs:
pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Read .NET Version
shell: pwsh
id: dotnet-version
run: |
$version = (Get-Content .\global.json -Raw | ConvertFrom-Json).sdk.version.TrimEnd('0') + 'x'
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append

- name: Setup .NET
uses: actions/setup-dotnet@v4
with: { dotnet-version: "${{ steps.dotnet-version.outputs.version }}" }

- name: Build
working-directory: src
shell: pwsh
run: dotnet build NoSQLite -c Release

- name: Test
if: inputs.test || inputs.publish
working-directory: test
run: dotnet test --project NoSQLite.Test -c Release

- name: Pack
if: inputs.publish
working-directory: src
run: dotnet pack NoSQLite --no-restore --no-build

- name: Push
if: inputs.publish
working-directory: artifacts/src/package/release
env:
SOURCE_URL: https://api.nuget.org/v3/index.json
NUGET_AUTH_TOKEN: ${{ secrets.nuget-key }}
run: dotnet nuget push *.nupkg --skip-duplicate -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: build
env: { DOTNET_NOLOGO: true }
on:
pull_request:
branches:
- main
paths:
- src/**
- test/**
types:
- opened
- ready_for_review
- review_requested
jobs:
pipeline:
uses: panoukos41/NoSQLite/.github/workflows/_.yaml@main
with:
test: true
19 changes: 19 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: publish
env: { DOTNET_NOLOGO: true }
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+ # Only matches vX.X.X where X is a number
paths:
- src/**
- test/**
jobs:
pipeline:
uses: panoukos41/NoSQLite/.github/workflows/_.yaml@main
with:
publish: true
secrets:
nuget-key: ${{ secrets.NUGET_API_KEY }}
56 changes: 0 additions & 56 deletions .github/workflows/release.yaml

This file was deleted.

Loading