Skip to content

Commit 5d8fab4

Browse files
committed
- Release preparation
1 parent 8af42d0 commit 5d8fab4

10 files changed

Lines changed: 394 additions & 31 deletions

File tree

.github/workflows/release-ci.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: release-ci
2+
3+
on:
4+
push:
5+
branches:
6+
- release/**
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
release:
12+
name: Build, Pack & Publish
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # Full history required by GitVersion
23+
24+
- name: Install GitVersion
25+
uses: gittools/actions/gitversion/setup@v3
26+
with:
27+
versionSpec: '5.x'
28+
29+
- name: Determine Version
30+
id: gitversion
31+
uses: gittools/actions/gitversion/execute@v3
32+
with:
33+
useConfigFile: true
34+
35+
- name: Set package version
36+
id: pkg_version
37+
run: |
38+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
39+
echo "version=${{ steps.gitversion.outputs.majorMinorPatch }}" >> $GITHUB_OUTPUT
40+
else
41+
echo "version=${{ steps.gitversion.outputs.semVer }}" >> $GITHUB_OUTPUT
42+
fi
43+
44+
- name: Print version
45+
run: |
46+
echo "SemVer : ${{ steps.gitversion.outputs.semVer }}"
47+
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
48+
echo "Package version: ${{ steps.pkg_version.outputs.version }}"
49+
50+
- name: Setup .NET
51+
uses: actions/setup-dotnet@v4
52+
with:
53+
dotnet-version: |
54+
8.0.x
55+
9.0.x
56+
10.0.x
57+
58+
- name: Restore
59+
run: dotnet restore ActiveForge/ActiveForge.sln
60+
61+
- name: Build
62+
run: dotnet build ActiveForge/ActiveForge.sln --configuration Release --no-restore
63+
64+
- name: Test
65+
run: dotnet test ActiveForge/ActiveForge.sln --configuration Release --no-build --framework net8.0
66+
67+
- name: Pack — Core
68+
run: |
69+
dotnet pack ActiveForge/src/ActiveForge/ActiveForge.csproj \
70+
--configuration Release --no-build \
71+
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
72+
--output ./artifacts
73+
74+
- name: Pack — SqlServer
75+
run: |
76+
dotnet pack ActiveForge/src/ActiveForge.SqlServer/ActiveForge.SqlServer.csproj \
77+
--configuration Release --no-build \
78+
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
79+
--output ./artifacts
80+
81+
- name: Pack — PostgreSQL
82+
run: |
83+
dotnet pack ActiveForge/src/ActiveForge.PostgreSQL/ActiveForge.PostgreSQL.csproj \
84+
--configuration Release --no-build \
85+
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
86+
--output ./artifacts
87+
88+
- name: Pack — SQLite
89+
run: |
90+
dotnet pack ActiveForge/src/ActiveForge.SQLite/ActiveForge.SQLite.csproj \
91+
--configuration Release --no-build \
92+
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
93+
--output ./artifacts
94+
95+
- name: Pack — MongoDB
96+
run: |
97+
dotnet pack ActiveForge/src/ActiveForge.MongoDB/ActiveForge.MongoDB.csproj \
98+
--configuration Release --no-build \
99+
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
100+
--output ./artifacts
101+
102+
- name: List artifacts
103+
run: ls -la ./artifacts/
104+
105+
- name: Publish to GitHub Packages
106+
run: |
107+
dotnet nuget add source \
108+
--username ${{ github.repository_owner }} \
109+
--password ${{ secrets.GITHUB_TOKEN }} \
110+
--store-password-in-clear-text \
111+
--name github \
112+
"https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
113+
dotnet nuget push "./artifacts/*.nupkg" \
114+
--source github \
115+
--skip-duplicate
116+
117+
- name: Publish to NuGet.org
118+
if: startsWith(github.ref, 'refs/tags/')
119+
run: |
120+
dotnet nuget push "./artifacts/*.nupkg" \
121+
--api-key ${{ secrets.NUGET_API_KEY }} \
122+
--source https://api.nuget.org/v3/index.json \
123+
--skip-duplicate
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "release-codeql"
13+
14+
on:
15+
push:
16+
branches:
17+
- release/**
18+
tags:
19+
- 'v*'
20+
21+
# Cancel in-progress runs on the same branch when a new push arrives
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: [ 'csharp' ]
39+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v3
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v3
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
55+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56+
# queries: security-extended,security-and-quality
57+
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@v3
63+
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
66+
67+
# If the Autobuild fails above, remove it and uncomment the following three lines.
68+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
69+
70+
# - run: |
71+
# echo "Run, Build Application using script"
72+
# ./location_of_script_within_repo/buildscript.sh
73+
74+
- name: Perform CodeQL Analysis
75+
uses: github/codeql-action/analyze@v3
76+
with:
77+
category: "/language:${{matrix.language}}"
78+
79+
80+

GitVersion.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
next-version: 1.0.0
2+
tag-prefix: '[vV]'
3+
mode: ContinuousDeployment
4+
branches:
5+
master:
6+
regex: ^master$|^main$
7+
tag: ''
8+
source-branches: ['develop']
9+
release:
10+
mode: ContinuousDelivery
11+
tag: 'beta'
12+
increment: Patch
13+
prevent-increment-of-merged-branch-version: true
14+
source-branches: ['master', 'develop']
15+
pre-release:
16+
regex: ^pre-release$|^pre-release/.*
17+
tag: alpha
18+
increment: Minor
19+
prevent-increment-of-merged-branch-version: true
20+
source-branches: ['master', 'develop']
21+
develop:
22+
regex: ^develop$|^dev$
23+
tag: beta
24+
increment: Minor
25+
source-branches: ['master']
26+
pull-request:
27+
tag: PullRequest
28+
tag-number-pattern: '[/-](?<number>\d+)'
29+
increment: Inherit
30+
regex: ^(pull|pull\-requests|pr)[/-]
31+
source-branches: ['master', 'develop', 'release', 'pre-release']
32+
feature:
33+
tag: '{BranchName}'
34+
increment: Inherit
35+
source-branches: ['master', 'develop', 'release']
36+
ignore:
37+
sha: []

images/Logo-6.png

7.28 KB
Loading

src/ActiveForge.MongoDB/ActiveForge.MongoDB.csproj

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net9.0;net10.0;net472;netstandard2.0;netstandard2.1</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>disable</ImplicitUsings>
77
<LangVersion>latest</LangVersion>
@@ -13,17 +13,38 @@
1313
<!-- ── Package identity ─────────────────────────────────────────────── -->
1414
<PackageId>ActiveForge.MongoDB</PackageId>
1515
<Title>ActiveForge ORM — MongoDB</Title>
16+
<Product>ActiveForge ORM</Product>
1617
<Description>
17-
MongoDB provider for ActiveForge ORM. Includes MongoDataConnection (extends DataConnection
18-
directly, not DBDataConnection), reflection-based BSON mapping, QueryTerm-to-FilterDefinition
19-
translation, auto-increment via __activeforge_counters collection, multi-document transaction
20-
support via MongoUnitOfWork, automatic $lookup join pipeline for embedded Record fields, and
21-
the AddActiveForgeMongoDB IServiceCollection extension for one-call DI registration.
22-
Requires the ActiveForge core package.
18+
Provides MongoDB adapter for ActiveForge ORM. Provides type-safe fields,
19+
composable query predicates, LINQ query translation, nested
20+
transactions, Unit of Work and DI auto-scan.
2321
</Description>
2422
<PackageTags>orm;active-record;crud;persistence;query;query-builder;query-language;orm-framework;orm-library;active-record-design-pattern;object-persistence;mongodb</PackageTags>
23+
<PackageReadmeFile>README.md</PackageReadmeFile>
24+
<PackageIcon>Logo-6.png</PackageIcon>
25+
<RepositoryUrl>https://github.com/CodeShayk/ActiveForge</RepositoryUrl>
26+
<PackageReleaseNotes>
27+
### v1.0.0 Highlights
28+
- Reflection-based BSON mapping (no external serializer configuration required)
29+
- `QueryTerm`-to-MongoDB `FilterDefinition` translation
30+
- Auto-increment ID support via `__activeforge_counters` collection
31+
- Multi-document transaction support via `MongoUnitOfWork`
32+
- Automatic `$lookup` aggregation pipeline for embedded Record fields (JOINs)
33+
- One-call DI registration via `AddActiveForgeMongoDB()` extension method.
34+
</PackageReleaseNotes>
2535
</PropertyGroup>
2636

37+
<ItemGroup>
38+
<None Include="..\..\images\Logo-6.png">
39+
<Pack>True</Pack>
40+
<PackagePath>\</PackagePath>
41+
</None>
42+
<None Include="..\..\README.md">
43+
<Pack>True</Pack>
44+
<PackagePath>\</PackagePath>
45+
</None>
46+
</ItemGroup>
47+
2748
<ItemGroup>
2849
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
2950
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Polyfill: 'init' accessors require this type, which only exists in .NET 5+.
2+
// Declaring it here makes it available for netstandard2.0, netstandard2.1, and net472 targets.
3+
#if !NET5_0_OR_GREATER
4+
namespace System.Runtime.CompilerServices
5+
{
6+
internal static class IsExternalInit { }
7+
}
8+
#endif

src/ActiveForge.PostgreSQL/ActiveForge.PostgreSQL.csproj

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
<Nullable>disable</Nullable>
66
<LangVersion>latest</LangVersion>
77
<AssemblyName>ActiveForge.PostgreSQL</AssemblyName>
@@ -11,15 +11,36 @@
1111
<!-- ── Package identity ─────────────────────────────────────────────── -->
1212
<PackageId>ActiveForge.PostgreSQL</PackageId>
1313
<Title>ActiveForge ORM — PostgreSQL</Title>
14+
<Product>ActiveForge ORM</Product>
1415
<Description>
15-
PostgreSQL provider for ActiveForge ORM. Includes PostgreSQLConnection (extends
16-
DBDataConnection), Npgsql adapter layer (NpgsqlAdapterCommand/Connection/Reader/Transaction),
17-
PostgreSQLUnitOfWork, and the AddActiveForgePostgreSQL IServiceCollection extension for
18-
one-call DI registration. Requires the ActiveForge core package.
16+
Provides PostgreSQL adapter for ActiveForge ORM. Provides type-safe fields,
17+
composable query predicates, LINQ query translation, nested
18+
transactions, Unit of Work and DI auto-scan.
1919
</Description>
2020
<PackageTags>orm;active-record;crud;persistence;query;query-builder;query-language;orm-framework;orm-library;active-record-design-pattern;object-persistence;postgresql</PackageTags>
21+
<PackageReadmeFile>README.md</PackageReadmeFile>
22+
<PackageIcon>Logo-6.png</PackageIcon>
23+
<PackageReleaseNotes>
24+
### v1.0.0 Highlights
25+
- Full Npgsql adapter layer for PostgreSQL connectivity
26+
- `PostgreSQLConnection` with automatic connection lifecycle management
27+
- `PostgreSQLUnitOfWork` for transactional grouping
28+
- One-call DI registration via `AddActiveForgePostgreSQL()` extension method
29+
- Pessimistic locking support with `FOR UPDATE` semantics.
30+
</PackageReleaseNotes>
2131
</PropertyGroup>
2232

33+
<ItemGroup>
34+
<None Include="..\..\images\Logo-6.png">
35+
<Pack>True</Pack>
36+
<PackagePath>\</PackagePath>
37+
</None>
38+
<None Include="..\..\README.md">
39+
<Pack>True</Pack>
40+
<PackagePath>\</PackagePath>
41+
</None>
42+
</ItemGroup>
43+
2344
<ItemGroup>
2445
<ProjectReference Include="..\ActiveForge\ActiveForge.csproj" />
2546
</ItemGroup>

0 commit comments

Comments
 (0)