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
96 changes: 96 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{md,markdown}]
trim_trailing_whitespace = false

[*.{yml,yaml,json}]
indent_size = 2

[*.{csproj,props,targets,slnx,xml}]
indent_size = 2

[*.cs]
csharp_indent_case_contents = true
csharp_indent_labels = flush_left
csharp_indent_switch_labels = true
csharp_preserve_single_line_blocks = true
csharp_new_line_before_open_brace = all
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_name_and_opening_parenthesis = true
csharp_space_between_method_declaration_name_and_open_parenthesis = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = false:suggestion
csharp_style_var_elsewhere = false:suggestion
csharp_style_expression_bodied_methods = false:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_operators = false:suggestion
csharp_style_expression_bodied_local_functions = false:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
csharp_style_expression_bodied_lambdas = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_using_directive_placement = outside_namespace:suggestion
dotnet_style_prefer_auto_properties = false:none
csharp_prefer_braces = true:suggestion
csharp_prefer_static_local_function = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
resharper_space_before_new_parentheses = true
resharper_space_before_method_call_parentheses = true
resharper_space_before_method_parentheses = true
resharper_space_before_empty_method_call_parentheses = true
resharper_space_before_empty_method_parentheses = true
resharper_space_before_typeof_parentheses = true
resharper_space_before_default_parentheses = true
resharper_space_before_checked_parentheses = true
resharper_space_before_sizeof_parentheses = true
resharper_space_before_nameof_parentheses = true
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: ['**']
pull_request:
branches: [main, develop]

permissions:
contents: read

jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v5

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'

- name: Restore
run: dotnet restore Terminal.Gui.Cli.slnx

- name: Build
run: dotnet build Terminal.Gui.Cli.slnx --no-restore -c Debug

- name: Verify code style
if: matrix.os == 'ubuntu-latest'
run: dotnet format Terminal.Gui.Cli.slnx --no-restore --verify-no-changes

- name: Terminal.Gui.Cli.Tests
run: dotnet run --project tests/Terminal.Gui.Cli.Tests --no-build -c Debug

- name: Terminal.Gui.Cli.IntegrationTests
run: dotnet run --project tests/Terminal.Gui.Cli.IntegrationTests --no-build -c Debug

- name: Terminal.Gui.Cli.SmokeTests
run: dotnet run --project tests/Terminal.Gui.Cli.SmokeTests --no-build -c Debug
104 changes: 104 additions & 0 deletions .github/workflows/finalize-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Finalize Release

on:
pull_request:
types: [closed]
branches: [main]

jobs:
finalize-release:
name: Tag, Release, and Back-merge
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout release merge commit
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: 0
token: ${{ secrets.RELEASE_PAT }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Extract release info from branch name
id: release
env:
RELEASE_BRANCH: ${{ github.event.pull_request.head.ref }}
shell: bash
run: |
BRANCH="$RELEASE_BRANCH"
TAG="${BRANCH#release/}"
SEMVER="${TAG#v}"

if echo "$SEMVER" | grep -q '-'; then
PRERELEASE="true"
else
PRERELEASE="false"
fi

echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "semver=${SEMVER}" >> "$GITHUB_OUTPUT"
echo "prerelease=${PRERELEASE}" >> "$GITHUB_OUTPUT"

- name: Check if tag already exists
shell: bash
run: |
if git rev-parse "${{ steps.release.outputs.tag }}" >/dev/null 2>&1; then
echo "::error::Tag ${{ steps.release.outputs.tag }} already exists."
exit 1
fi

- name: Create annotated tag
shell: bash
run: |
TAG="${{ steps.release.outputs.tag }}"
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
TAG: ${{ steps.release.outputs.tag }}
PRERELEASE: ${{ steps.release.outputs.prerelease }}
shell: bash
run: |
PRERELEASE_FLAG=""
if [ "$PRERELEASE" = "true" ]; then
PRERELEASE_FLAG="--prerelease"
fi

gh release create "$TAG" \
--title "$TAG" \
--generate-notes \
$PRERELEASE_FLAG

- name: Delete release branch
env:
RELEASE_BRANCH: ${{ github.event.pull_request.head.ref }}
shell: bash
run: |
BRANCH="$RELEASE_BRANCH"
git push origin --delete "$BRANCH" || true

- name: Create back-merge PR
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
TAG: ${{ steps.release.outputs.tag }}
shell: bash
run: |
BACKMERGE_BRANCH="backmerge/${TAG}"

git checkout -b "$BACKMERGE_BRANCH" "${{ github.event.pull_request.merge_commit_sha }}"
git push origin "$BACKMERGE_BRANCH"

gh pr create \
--base develop \
--head "$BACKMERGE_BRANCH" \
--title "Back-merge ${TAG} from main into develop" \
--body "Automatic back-merge after release ${TAG}. Merge this to keep \`develop\` in sync with \`main\`."
Loading
Loading