Skip to content

Commit c693dc0

Browse files
committed
Initial commit
0 parents  commit c693dc0

22 files changed

+967
-0
lines changed

.editorconfig

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# EditorConfig is awesome:http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_style = space
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
indent_size = 4
14+
15+
# Xml project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}]
17+
indent_size = 2
18+
19+
# Xml config files
20+
[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# YAML files
24+
[*.{yaml,yml}]
25+
indent_size = 2
26+
27+
# JSON files
28+
[*.json]
29+
indent_size = 2
30+
31+
# Dotnet code style settings:
32+
[*.{cs,vb}]
33+
# Sort using and Import directives with System.* appearing first
34+
dotnet_sort_system_directives_first = true
35+
# Avoid "this." and "Me." if not necessary
36+
dotnet_style_qualification_for_field = false:suggestion
37+
dotnet_style_qualification_for_property = false:suggestion
38+
dotnet_style_qualification_for_method = false:suggestion
39+
dotnet_style_qualification_for_event = false:suggestion
40+
41+
# Use language keywords instead of framework type names for type references
42+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
43+
dotnet_style_predefined_type_for_member_access = true:suggestion
44+
45+
# Suggest more modern language features when available
46+
dotnet_style_object_initializer = true:suggestion
47+
dotnet_style_collection_initializer = true:suggestion
48+
dotnet_style_coalesce_expression = true:suggestion
49+
dotnet_style_null_propagation = true:suggestion
50+
dotnet_style_explicit_tuple_names = true:suggestion
51+
52+
# CSharp code style settings:
53+
54+
# IDE0040: Add accessibility modifiers
55+
dotnet_style_require_accessibility_modifiers = omit_if_default:error
56+
57+
# IDE0040: Add accessibility modifiers
58+
dotnet_diagnostic.IDE0040.severity = error
59+
60+
[*.cs]
61+
# Prefer "var" everywhere
62+
csharp_style_var_for_built_in_types = true:suggestion
63+
csharp_style_var_when_type_is_apparent = true:suggestion
64+
csharp_style_var_elsewhere = true:suggestion
65+
66+
# Prefer method-like constructs to have an expression-body
67+
csharp_style_expression_bodied_methods = true:none
68+
csharp_style_expression_bodied_constructors = true:none
69+
csharp_style_expression_bodied_operators = true:none
70+
71+
# Prefer property-like constructs to have an expression-body
72+
csharp_style_expression_bodied_properties = true:none
73+
csharp_style_expression_bodied_indexers = true:none
74+
csharp_style_expression_bodied_accessors = true:none
75+
76+
# Suggest more modern language features when available
77+
csharp_style_pattern_matching_over_is_with_cast_check = true:error
78+
csharp_style_pattern_matching_over_as_with_null_check = true:error
79+
csharp_style_inlined_variable_declaration = true:suggestion
80+
csharp_style_throw_expression = true:suggestion
81+
csharp_style_conditional_delegate_call = true:suggestion
82+
83+
# Newline settings
84+
csharp_new_line_before_open_brace = all
85+
csharp_new_line_before_else = true
86+
csharp_new_line_before_catch = true
87+
csharp_new_line_before_finally = true
88+
csharp_new_line_before_members_in_object_initializers = true
89+
csharp_new_line_before_members_in_anonymous_types = true

.gitattributes

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# sln, csproj files (and friends) are always CRLF, even on linux
2+
*.sln text eol=crlf
3+
*.proj text eol=crlf
4+
*.csproj text eol=crlf
5+
6+
# These are windows specific files which we may as well ensure are
7+
# always crlf on checkout
8+
*.bat text eol=crlf
9+
*.cmd text eol=crlf
10+
11+
# Opt in known filetypes to always normalize line endings on checkin
12+
# and always use native endings on checkout
13+
*.c text
14+
*.config text
15+
*.h text
16+
*.cs text
17+
*.md text
18+
*.tt text
19+
*.txt text
20+
21+
# Some must always be checked out as lf so enforce that for those files
22+
# If these are not lf then bash/cygwin on windows will not be able to
23+
# excute the files
24+
*.sh text eol=lf

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: devlooped

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us fix a problem.
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
---
8+
9+
## Describe the Bug
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
## Steps to Reproduce
14+
15+
<!-- Tell us how to reproduce the issue. Ideally provide a failing unit test. -->
16+
17+
```c#
18+
public class ReproTest
19+
{
20+
[Fact]
21+
public void Repro()
22+
{
23+
// arrange
24+
25+
// act
26+
27+
// assert
28+
}
29+
}
30+
```
31+
32+
## Expected Behavior
33+
34+
<!-- Describe what you expected to happen. -->
35+
36+
## Exception with Stack Trace
37+
38+
<!-- If you see an exception, put the WHOLE THING here. -->
39+
40+
```text
41+
Put the exception with stack trace here.
42+
```
43+
44+
## Version Info
45+
46+
<!-- Main project version and other relevant dependencies you are using. -->
47+
48+
## Additional Info
49+
50+
<!-- Add any other context about the problem here. -->

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: nuget
7+
directory: /
8+
schedule:
9+
interval: weekly

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Builds and runs tests in all three supported OSes
2+
# Pushes CI feed if secrets.SLEET_CONNECTION is provided
3+
4+
name: build
5+
on:
6+
push:
7+
branches: [ main, dev, 'feature/*', 'rel/*' ]
8+
paths-ignore:
9+
- changelog.md
10+
- code-of-conduct.md
11+
- security.md
12+
- support.md
13+
pull_request:
14+
types: [opened, synchronize, reopened]
15+
16+
env:
17+
DOTNET_NOLOGO: true
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
jobs:
24+
dotnet-format:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: 🤘 checkout
28+
uses: actions/checkout@v2
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
33+
- name: ✓ ensure format
34+
run: |
35+
dotnet tool update -g dotnet-format --version 5.0.*
36+
dotnet restore
37+
dotnet format --check -v:diag
38+
39+
build:
40+
name: build-${{ matrix.os }}
41+
needs: dotnet-format
42+
runs-on: ${{ matrix.os }}
43+
strategy:
44+
matrix:
45+
os: [ubuntu-latest, windows-latest, macOS-latest]
46+
steps:
47+
- name: 🤘 checkout
48+
uses: actions/checkout@v2
49+
with:
50+
submodules: recursive
51+
fetch-depth: 0
52+
53+
- name: 🙏 build
54+
run: dotnet build -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
55+
56+
- name: 🧪 test
57+
run: dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m
58+
59+
- name: 📦 pack
60+
run: dotnet pack -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
61+
62+
# Only push CI package to sleet feed if building on ubuntu (fastest)
63+
- name: 🚀 sleet
64+
env:
65+
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
66+
if: matrix.os == 'ubuntu-latest' && env.SLEET_CONNECTION != ''
67+
run: |
68+
dotnet tool install -g --version 4.0.18 sleet
69+
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"

.github/workflows/changelog.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: changelog
2+
on:
3+
release:
4+
types: [released]
5+
workflow_dispatch:
6+
7+
env:
8+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
9+
10+
jobs:
11+
changelog:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: 🔍 GH_TOKEN
15+
if: env.GH_TOKEN == ''
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
19+
20+
- name: 🤘 checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
ref: main
25+
token: ${{ env.GH_TOKEN }}
26+
27+
- name: ⚙ changelog
28+
uses: faberNovel/github-changelog-generator-action@master
29+
with:
30+
options: --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md
31+
32+
- name: 🚀 changelog
33+
run: |
34+
git config --local user.name github-actions
35+
git config --local user.email [email protected]
36+
git add changelog.md
37+
(git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done"

.github/workflows/dotnet-file.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Synchronizes .netconfig-configured files with dotnet-file
2+
name: dotnet-file
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
push:
8+
branches: [ 'dotnet-file' ]
9+
10+
env:
11+
DOTNET_NOLOGO: true
12+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
13+
14+
jobs:
15+
sync:
16+
runs-on: windows-latest
17+
steps:
18+
- name: 🔍 GH_TOKEN
19+
if: env.GH_TOKEN == ''
20+
shell: bash
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
24+
25+
- name: 🤘 checkout
26+
uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
ref: main
30+
token: ${{ env.GH_TOKEN }}
31+
32+
- name: 🔄 sync
33+
run: |
34+
dotnet tool update -g dotnet-gcm
35+
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN
36+
gh auth status
37+
38+
dotnet tool update -g dotnet-file
39+
dotnet file sync -c:$env:TEMP\dotnet-file.md
40+
if (test-path $env:TEMP\dotnet-file.md) {
41+
echo 'CHANGES<<EOF' >> $env:GITHUB_ENV
42+
cat $env:TEMP\dotnet-file.md >> $env:GITHUB_ENV
43+
echo 'EOF' >> $env:GITHUB_ENV
44+
cat $env:TEMP\dotnet-file.md
45+
} else {
46+
echo 'No changelog was generated'
47+
}
48+
49+
- name: ✍ pull request
50+
uses: peter-evans/create-pull-request@v3
51+
with:
52+
base: main
53+
branch: dotnet-file-sync
54+
delete-branch: true
55+
labels: dependencies
56+
commit-message: Bump files with dotnet-file sync
57+
58+
${{ env.CHANGES }}
59+
title: "Bump files with dotnet-file sync"
60+
body: ${{ env.CHANGES }}
61+
token: ${{ env.GH_TOKEN }}

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Builds a final release version and pushes to nuget.org
2+
# whenever a release is published.
3+
# Requires: secrets.NUGET_API_KEY
4+
5+
name: publish
6+
on:
7+
release:
8+
types: [released]
9+
10+
env:
11+
DOTNET_NOLOGO: true
12+
Configuration: Release
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: 🤘 checkout
19+
uses: actions/checkout@v2
20+
with:
21+
submodules: recursive
22+
fetch-depth: 0
23+
24+
- name: 🙏 build
25+
run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v}
26+
27+
- name: 🧪 test
28+
run: dotnet test --no-build -m:1
29+
30+
- name: 📦 pack
31+
run: dotnet pack -m:1 -p:version=${GITHUB_REF#refs/*/v}
32+
33+
- name: 🚀 nuget
34+
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate

0 commit comments

Comments
 (0)