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
5 changes: 4 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"allow": [
"Bash(git log:*)",
"Bash(dotnet test:*)",
"Bash(dotnet build:*)"
"Bash(dotnet build:*)",
"Bash(git checkout:*)",
"Bash(dotnet clean:*)",
"Bash(gh pr:*)"
],
"deny": [],
"ask": []
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/dotnet.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pull Request

on:
pull_request:
branches: [ "main" ]

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: [ '9.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
127 changes: 127 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Release

on:
push:
branches: [ "main" ]

jobs:
check-version-tag:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.current-version }}
prev_tag: ${{ steps.prev_tag.outputs.tag }}
is_new_tag: ${{ !steps.tag_exists.outputs.exists }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Get version from ReflectorNet.csproj
id: get_version
shell: bash
run: |
version=$(grep -oP '<Version>\K[^<]+' ReflectorNet/ReflectorNet.csproj)
echo "current-version=$version" >> $GITHUB_OUTPUT
echo "Found version: $version"

- name: Find previous version tag
id: prev_tag
uses: WyriHaximus/github-action-get-previous-tag@v1

- name: Check if tag exists
id: tag_exists
uses: mukunku/tag-exists-action@v1.6.0
with:
tag: ${{ steps.get_version.outputs.current-version }}

build-and-test:
runs-on: ${{ matrix.os }}
needs: check-version-tag
if: needs.check-version-tag.outputs.is_new_tag == 'true'
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: [ '9.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release

modify-release:
runs-on: ubuntu-latest
needs: [check-version-tag, build-and-test]
if: needs.check-version-tag.outputs.is_new_tag == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Generate release description
id: rel_desc
env:
GH_TOKEN: ${{ github.token }}
run: |
set -e
version=${{ needs.check-version-tag.outputs.version }}
prev_tag=${{ needs.check-version-tag.outputs.prev_tag }}
repo_url="https://github.com/${GITHUB_REPOSITORY}"
today=$(date +'%B %e, %Y')

echo "repo_url: $repo_url"
echo "today: $today"

echo "# ReflectorNet Version $version" > release.md
echo "**Released:** *$today*" >> release.md

echo "" >> release.md
echo "---" >> release.md
echo "" >> release.md

if [ -n "$prev_tag" ]; then
echo "## Comparison" >> release.md
echo "See every change: [Compare $prev_tag...$version]($repo_url/compare/$prev_tag...$version)" >> release.md

echo "" >> release.md
echo "---" >> release.md
echo "" >> release.md
fi

echo "## Commit Summary (Newest → Oldest)" >> release.md
for sha in $(git log --pretty=format:'%H' $prev_tag..HEAD); do
username=$(gh api repos/${GITHUB_REPOSITORY}/commits/$sha --jq '.author.login // .commit.author.name')
message=$(git log -1 --pretty=format:'%s' $sha)
short_sha=$(git log -1 --pretty=format:'%h' $sha)
echo "- [\`$short_sha\`]($repo_url/commit/$sha) — $message by @$username" >> release.md
done
printf "release_body<<ENDOFRELEASEBODY\n%s\nENDOFRELEASEBODY\n" "$(cat release.md)" >> $GITHUB_ENV
echo "success=true" >> $GITHUB_OUTPUT

deploy:
needs: [build-and-test, check-version-tag]
runs-on: ubuntu-latest
if: needs.check-version-tag.outputs.is_new_tag == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Pack
run: dotnet pack ReflectorNet/ReflectorNet.csproj --no-build --configuration Release --output ./packages
- name: Publish to NuGet
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

# ReflectorNet

[![nuget](https://img.shields.io/nuget/v/com.IvanMurzak.ReflectorNet)](https://www.nuget.org/packages/com.IvanMurzak.ReflectorNet/) ![License](https://img.shields.io/github/license/IvanMurzak/ReflectorNet) [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
[![nuget](https://img.shields.io/nuget/v/com.IvanMurzak.ReflectorNet)](https://www.nuget.org/packages/com.IvanMurzak.ReflectorNet/)
![License](https://img.shields.io/github/license/IvanMurzak/ReflectorNet)
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)

[![Tests](https://github.com/IvanMurzak/ReflectorNet/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/IvanMurzak/ReflectorNet/actions/workflows/dotnet.yml) ![.NET 9.0](https://img.shields.io/badge/.NET-9.0-blue?logoColor=white) ![netstandard2.0](https://img.shields.io/badge/.NET-netstandard2.0-blue?logoColor=white) ![netstandard2.1](https://img.shields.io/badge/.NET-netstandard2.1-blue?logoColor=white)
[![Tests](https://github.com/IvanMurzak/ReflectorNet/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/IvanMurzak/ReflectorNet/actions/workflows/release.yml)
![.NET 9.0](https://img.shields.io/badge/.NET-9.0-blue?logoColor=white)
![netstandard2.1](https://img.shields.io/badge/.NET-netstandard2.1-blue?logoColor=white)

ReflectorNet is an advanced .NET reflection toolkit specifically designed for AI-driven scenarios. It provides sophisticated reflection-based serialization, deserialization, population, and method invocation capabilities that enable seamless integration between AI systems and .NET applications.

Expand Down
Loading