Skip to content

Commit

Permalink
Git & GitHub files
Browse files Browse the repository at this point in the history
  • Loading branch information
Seramis committed Feb 18, 2025
0 parents commit 058749a
Show file tree
Hide file tree
Showing 11 changed files with 630 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: "🐛 Bug Report"
description: "Report a bug or unexpected behavior in the project."
title: "[Bug]: "
labels:
- bug
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report a bug! Please provide as much detail as possible.
- type: checkboxes
id: preconditions
attributes:
label: Things to check
options:
- label: I have searched the **existing issues** for this bug
required: true
validations:
required: true

- type: textarea
id: bug_description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: Enter the bug details here
validations:
required: true

- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to reproduce
description: Describe the steps to reproduce the behavior.
placeholder: "1. ...\n2. ...\n3. ..."
validations:
required: true

- type: textarea
id: expected_behavior
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true

- type: textarea
id: additional_context
attributes:
label: Additional context
description: Add any other context or screenshots about the problem.

- type: input
id: version
attributes:
label: WeakEvent version
description: With which WeakEvent NuGet version are you experiencing the issue?
placeholder: WeakEvent version number
validations:
required: true

- type: input
id: dotnet-version
attributes:
label: .NET version
description: With which .NET version are you experiencing the issue?
placeholder: .NET version
validations:
required: true

- type: dropdown
id: environment
attributes:
label: Environment
description: Provide details about the environment where the issue occurs.
multiple: true
options:
- Windows
- macOS
- Linux
- Other
validations:
required: true

- type: checkboxes
id: will-patch
attributes:
label: Contribute a patch?
description: |
If you plan to contribute a patch for this issue yourself, please check the box below - to tell us and others looking at the issue that someone’s already working on it. If you do check this box, please try to send a pull request within 7 days or so.
options:
- label: I’ll contribute a patch for this myself.

- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ByteAether/WeakEvent/blob/main/CODE_OF_CONDUCT.md).
options:
- label: I agree to follow this project's Code of Conduct
required: true
75 changes: 75 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "🚀 Feature Request"
description: "Suggest a new feature or improvement to the project."
title: "[Feature Request]: "
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
Thank you for suggesting a feature! Please provide as much detail as possible.
- type: checkboxes
id: preconditions
attributes:
label: Things to check
options:
- label: I have searched the **existing issues** for this bug
required: true
validations:
required: true

- type: textarea
id: feature_description
attributes:
label: Describe the feature
description: A clear and concise description of what you want to happen.
placeholder: Enter the feature details here
validations:
required: true

- type: textarea
id: problem_to_solve
attributes:
label: Problem to solve
description: Describe the problem your feature will address.
placeholder: Enter the problem details here
validations:
required: true

- type: textarea
id: examples
attributes:
label: Have you seen this feature anywhere else?
description: Please provide links to other implementations, or screenshots or videos of the expected behavior if possible.
placeholder: Show us examples!

- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Describe any alternative solutions or features you’ve considered.

- type: textarea
id: additional_context
attributes:
label: Additional context
description: Add any other context or screenshots to explain your feature request.

- type: checkboxes
id: will-patch
attributes:
label: Contribute a patch?
description: |
If you plan to contribute a patch for this issue yourself, please check the box below - to tell us and others looking at the issue that someone’s already working on it. If you do check this box, please try to send a pull request within 7 days or so.
options:
- label: I’ll contribute a patch for this myself.

- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ByteAether/WeakEvent/blob/main/CODE_OF_CONDUCT.md).
options:
- label: I agree to follow this project's Code of Conduct
required: true
44 changes: 44 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- Provide a general summary of your changes in the Title above -->
<!-- Keep the title short and descriptive, as it will be used as a commit message -->

## Description
<!-- Provide a detailed description of your changes and explain why they are needed. -->

## Related Issues
<!-- List any related issues by number (e.g., "Fixes #123", "Closes #456"). -->

- Fixes #
- Closes #
- Related to #

## Type of Change
<!-- Check all that apply and provide more details if needed. Put an `x` in only one box that applies best: -->

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
- [ ] Other (please specify):

## Checklist
<!-- Ensure the following tasks are completed before submission. -->
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] The PR is submitted to the correct branch (`main`).
- [ ] My code follows the project's coding style. (`.editorconfig`)
- [ ] I have commented my code, particularly in hard-to-understand areas and public interfaces.
- [ ] I have added or updated tests for the changes I made.
- [ ] All new and existing tests passed.
- [ ] I have updated the documentation where applicable.

## Testing Instructions
<!-- Explain how the changes were tested and how reviewers can verify them. -->

1. Step 1
2. Step 2
3. Step 3

## Screenshots (if applicable)

## Additional Notes
<!-- Add any other relevant context, considerations, or important details. -->
7 changes: 7 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly" # Check for updates to GitHub Actions every week
44 changes: 44 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Test

on:
push:
branches:
- main
paths:
- src/**
pull_request:
branches:
- main
paths:
- src/**

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.x
6.x
- name: Restore dependencies
run: dotnet restore src/WeakEvent.sln

- name: Build
run: dotnet build --no-restore --configuration Release src/WeakEvent.sln

- name: Run tests
continue-on-error: true
run: dotnet test --no-build --verbosity normal --logger "trx" --configuration Release src/WeakEvent.sln

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./**/TestResults/**/*.trx
56 changes: 56 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
paths:
- src/**
pull_request:
branches: [ "main" ]
paths:
- src/**
schedule:
- cron: '20 6 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

permissions:
actions: read # Allow GitHub Actions to read workflow files
contents: read # Allow access to repository contents
security-events: write # Allow writing security alerts to the Security tab

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ] # Specify the language(s) to analyze

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.x
6.x
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/workflows/codeql/codeql-config.yml

- name: Build the code
run: |
# Restore dependencies and build the C# project
dotnet restore src/WeakEvent/WeakEvent.csproj
dotnet build --no-incremental --configuration Release src/WeakEvent/WeakEvent.csproj
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
12 changes: 12 additions & 0 deletions .github/workflows/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Security and Quality"

queries:
- uses: security-and-quality

query-filters:
- exclude:
id: cs/useless-if-statement
- exclude:
id: cs/empty-block
- exclude:
id: cs/useless-assignment-to-local
37 changes: 37 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to NuGet

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.x
6.x
- name: 'Get Version'
id: version
run: echo "version-without-v=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Pack
run: dotnet pack --configuration Release /p:ContinuousIntegrationBuild=true /p:PackageVersion=${{ steps.version.outputs.version-without-v }} /p:PackageReleaseNotes="See https://github.com/ByteAether/WeakEvent/releases/tag/${{ github.event.release.tag_name }}" --output ./output src/WeakEvent/WeakEvent.csproj

- name: Upload NuGet package as artifact
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: ./output/*.nupkg

- name: Publish to NuGet
run: dotnet nuget push ./output/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
Loading

0 comments on commit 058749a

Please sign in to comment.