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
87 changes: 69 additions & 18 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
tags:
- 'v*'

# Cancel in-progress runs on the same branch when a new push arrives
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
name: Build, Pack & Publish
Expand All @@ -15,6 +20,34 @@ jobs:
contents: read
packages: write

services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "Pa55w0rd!"
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Pa55w0rd!' -No -Q 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 10

postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: Pa55w0rd
POSTGRES_DB: postgres
ports:
- 5455:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,16 +68,17 @@ jobs:
- name: Set package version
id: pkg_version
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "version=${{ steps.gitversion.outputs.majorMinorPatch }}" >> $GITHUB_OUTPUT
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "version=$(echo '${{ github.ref_name }}' | sed 's/^v//')" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.gitversion.outputs.semVer }}" >> $GITHUB_OUTPUT
fi

- name: Print version
run: |
echo "SemVer : ${{ steps.gitversion.outputs.semVer }}"
echo "SemVer : ${{ steps.gitversion.outputs.semVer }}"
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "PreReleaseTag : ${{ steps.gitversion.outputs.preReleaseTag }}"
echo "Package version: ${{ steps.pkg_version.outputs.version }}"

- name: Setup .NET
Expand All @@ -56,45 +90,67 @@ jobs:
10.0.x

- name: Restore
run: dotnet restore ActiveForge/ActiveForge.sln
run: dotnet restore ActiveForge.sln

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

- name: Start MongoDB replica set
run: |
docker run -d --name mongo \
-p 27017:27017 \
mongo:7 --replSet rs0 --bind_ip_all
# Wait for mongod to accept connections
for i in $(seq 1 30); do
docker exec mongo mongosh --quiet --eval "db.adminCommand('ping')" \
&& break || sleep 2
done
# Initialise the single-node replica set
docker exec mongo mongosh --quiet --eval \
"rs.initiate({_id:'rs0',members:[{_id:0,host:'127.0.0.1:27017'}]})"
# Wait until the node becomes PRIMARY
for i in $(seq 1 20); do
STATUS=$(docker exec mongo mongosh --quiet --eval "rs.status().myState")
[ "$STATUS" = "1" ] && break || sleep 2
done

- name: Test
run: dotnet test ActiveForge/ActiveForge.sln --configuration Release --no-build --framework net8.0
env:
SS_ADMIN_CONNSTR: "Server=localhost,1433;Database=master;User Id=sa;Password=Pa55w0rd!;TrustServerCertificate=True"
PG_ADMIN_CONNSTR: "Host=localhost;Port=5455;Database=postgres;Username=postgres;Password=Pa55w0rd"
run: dotnet test ActiveForge.sln --configuration Release --no-build --framework net8.0

- name: Pack — Core
run: |
dotnet pack ActiveForge/src/ActiveForge/ActiveForge.csproj \
dotnet pack src/ActiveForge/ActiveForge.csproj \
--configuration Release --no-build \
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
--output ./artifacts

- name: Pack — SqlServer
run: |
dotnet pack ActiveForge/src/ActiveForge.SqlServer/ActiveForge.SqlServer.csproj \
dotnet pack src/ActiveForge.SqlServer/ActiveForge.SqlServer.csproj \
--configuration Release --no-build \
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
--output ./artifacts

- name: Pack — PostgreSQL
run: |
dotnet pack ActiveForge/src/ActiveForge.PostgreSQL/ActiveForge.PostgreSQL.csproj \
dotnet pack src/ActiveForge.PostgreSQL/ActiveForge.PostgreSQL.csproj \
--configuration Release --no-build \
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
--output ./artifacts

- name: Pack — SQLite
run: |
dotnet pack ActiveForge/src/ActiveForge.SQLite/ActiveForge.SQLite.csproj \
dotnet pack src/ActiveForge.SQLite/ActiveForge.SQLite.csproj \
--configuration Release --no-build \
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
--output ./artifacts

- name: Pack — MongoDB
run: |
dotnet pack ActiveForge/src/ActiveForge.MongoDB/ActiveForge.MongoDB.csproj \
dotnet pack src/ActiveForge.MongoDB/ActiveForge.MongoDB.csproj \
--configuration Release --no-build \
-p:PackageVersion=${{ steps.pkg_version.outputs.version }} \
--output ./artifacts
Expand All @@ -104,14 +160,9 @@ jobs:

- name: Publish to GitHub Packages
run: |
dotnet nuget add source \
--username ${{ github.repository_owner }} \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github \
"https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
dotnet nuget push "./artifacts/*.nupkg" \
--source github \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
--skip-duplicate

- name: Publish to NuGet.org
Expand Down
11 changes: 10 additions & 1 deletion ActiveForge.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.2.11415.280 d18.0
VisualStudioVersion = 18.2.11415.280
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveForge", "src\ActiveForge\ActiveForge.csproj", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}"
EndProject
Expand Down Expand Up @@ -31,11 +31,20 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{D54AC37D-D3E3-48A9-BDFE-4C19404F7C00}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{D6383414-22E9-4C28-8500-8963CB6942DF}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
GitVersion.yml = GitVersion.yml
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{45231C39-1C92-4264-982D-6B40708CA0BD}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.github\workflows\master-build.yml = .github\workflows\master-build.yml
.github\workflows\master-codeql.yml = .github\workflows\master-codeql.yml
.github\workflows\release-ci.yml = .github\workflows\release-ci.yml
.github\workflows\release-codeql.yml = .github\workflows\release-codeql.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{497629F0-306C-4BC9-99D1-B5C6EA2B2E6F}"
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,19 @@ ActiveForge streamlines data-centric development with a cohesive approach to ent
---

## Requirements

- .NET 8.0
- One provider package:
- SQL Server → `ActiveForge.SqlServer` (wraps `Microsoft.Data.SqlClient` 5.2.1)
- PostgreSQL → `ActiveForge.PostgreSQL` (wraps `Npgsql` 8.0.3)
- MongoDB → `ActiveForge.MongoDB` (wraps `MongoDB.Driver` 2.28.0)
- SQLite → `ActiveForge.SQLite` (wraps `Microsoft.Data.Sqlite` 8.0.0)
┌────────────┬──────────────────────────────────────────────────────────────────────────────────────────────┐
│ Project │ Targets │
├────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤
│ Core │ net8.0;net9.0;net10.0;net472;netstandard2.0;netstandard2.1 │
├────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤
│ SqlServer │ net8.0;net9.0;net10.0;net472;netstandard2.0;netstandard2.1 │
├────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤
│ PostgreSQL │ net8.0;net9.0;net10.0 — Npgsql 8 limits this │
├────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤
│ SQLite │ net8.0;net9.0;net10.0;netstandard2.0;netstandard2.1 — net472 excluded (native binaries risk) │
├────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤
│ MongoDB │ net8.0;net9.0;net10.0;net472;netstandard2.0;netstandard2.1 │
└────────────┴──────────────────────────────────────────────────────────────────────────────────────────────┘

---

Expand Down
Loading
Loading