Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into tests_on_windows_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ProphetLamb authored Sep 26, 2022
2 parents c016ca3 + 3020255 commit 9fd0a67
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 35 deletions.
10 changes: 10 additions & 0 deletions .github/nightly_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/env bash

# Obtain the latest version from the stable branch
ver=$(grep -oPm1 "(?<=<Version>)[^<]+" src/Directory.Build.props)

# Generate the nightly version
ver="v$ver-nightly$(date +%Y%m%d)"
export NIGHTLY_TAG=$ver
# Set environment variable for use in the next step
echo "NIGHTLY_TAG=$ver" >>$GITHUB_ENV
20 changes: 20 additions & 0 deletions .github/patch_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/env bash
# This script is used to update the patch versions of the project.

# Get the current version tag from the argument
cur_ver=$1
# Convert the tag to a SemVer compatbile version
cur_ver=${cur_ver#v}

# Read the version from src/Directory.Build.props
# `<Version>1.0.4</Version>`. We later need to update the property
ver=$(grep -oPm1 "(?<=<Version>)[^<]+" src/Directory.Build.props)

# The version is defined in src/Directory.Build.props as a property
echo "Patching project version from $ver to $cur_ver"
sed -i "s/<Version>.*<\/Version>/<Version>$cur_ver<\/Version>/" src/Directory.Build.props

# The version is also defined in the README.md
# Replace the version in `Version="1.0.3"` with the current version
echo "Patching README.md version from $ver to $cur_ver"
sed -i "s/Version=\".*\"/Version=\"$cur_ver\"/" README.md
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continues Integration
name: Build & Test

on:
workflow_dispatch:
Expand All @@ -21,6 +21,9 @@ jobs:
[{ ch: "3.1", ver: "netcoreapp31" }, { ch: "6.0", ver: "net60" }]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize Cache
uses: actions/cache@v3
with:
Expand All @@ -44,9 +47,6 @@ jobs:
~/dotnet-install.sh -c ${{ matrix.dotnet.ch }}
dotnet --info
- name: Checkout
uses: actions/checkout@v3

- name: Restore Dependencies
run: dotnet restore

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Nightly

on:
schedule:
- cron: "0 0 * * *"

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
defaults:
run:
shell: bash

jobs:
nightly:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master

- name: Get version
run: |
.github/nightly_version.sh
- name: Patch version
run: |
.github/patch_version.sh ${{ env:NIGHTLY_TAG }}
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ env:NIGHTLY_TAG }}
release_name: ${{ env:NIGHTLY_TAG }} - Automated nightly release
generateReleaseNotes: true
13 changes: 9 additions & 4 deletions .github/workflows/cd.yml → .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Continues Delivery
name: Nuget

on:
workflow_dispatch:
release:
types: [published]
env:
Expand All @@ -17,7 +16,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Initialize Cache
- name: Checkout
uses: actions/checkout@v3

- name: Initialize cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
Expand All @@ -26,19 +28,22 @@ jobs:
restore-keys: |
${{ runner.os }}-nuget
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: Build
run: dotnet build -c:Release

- name: Pack
run: dotnet pack -c:Release -o:$(pwd)/publish

- name: Artifacts
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./publish/*.nupkg

- name: Publish
run: dotnet nuget push $(pwd)/publish/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
type: string
description: Tag
required: true
message:
type: string
description: Message
required: true
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
defaults:
run:
shell: bash

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Merge master -> release
uses: devmasx/merge-branch@master
with:
type: now
from_branch: master
target_branch: release
github_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
ref: release

- name: Patch version
run: |
../patch_version.sh ${{ github.event.inputs.tag }}
- name: Commit version
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_options: "--no-verify --signoff"
file_pattern: "**.props *.md"

- name: Merge release -> master
uses: devmasx/merge-branch@master
with:
type: now
from_branch: release
target_branch: master
github_token: ${{ github.token }}

- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: ${{ github.event.inputs.tag }} - ${{ github.event.inputs.message }}
generateReleaseNotes: true
5 changes: 2 additions & 3 deletions src/Abstractions/Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Abstractions for the SurrealDB driver</Description>
<PackageVersion>$(SurrealAbstractionsVersion)</PackageVersion>
<AssemblyName>SurrealDB.Abstractions</AssemblyName>
<PackageTags>surrealdb sql nosql database connector abstractions</PackageTags>
</PropertyGroup>
Expand All @@ -16,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Configuration\Configuration.csproj" />
<ProjectReference Include="..\Models\Models.csproj" />
<ProjectReference Include="..\Configuration\Configuration.csproj" />
<ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Common utility for the SurrealDB driver</Description>
<PackageVersion>$(SurrealCommonVersion)</PackageVersion>
<AssemblyName>SurrealDB.Common</AssemblyName>
<PackageTags>surrealdb sql nosql database connector</PackageTags>
</PropertyGroup>
Expand All @@ -17,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="6.0.6" />
<PackageReference Include="System.Text.Json" Version="6.0.6" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Configuration/Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Configuration for the SurrealDB driver</Description>
<PackageVersion>$(SurrealConfigVersion)</PackageVersion>
<AssemblyName>SurrealDB.Configuration</AssemblyName>
<PackageTags>surrealdb sql nosql database connector</PackageTags>
</PropertyGroup>
Expand All @@ -16,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>

</Project>
12 changes: 2 additions & 10 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<SurrealDriverRestVersion>1.0.4</SurrealDriverRestVersion>
<SurrealDriverRpcVersion>1.0.4</SurrealDriverRpcVersion>
<SurrealAbstractionsVersion>1.0.4</SurrealAbstractionsVersion>
<SurrealCommonVersion>1.0.4</SurrealCommonVersion>
<SurrealConfigVersion>1.0.4</SurrealConfigVersion>
<SurrealHostingExtensionsVersion>1.0.4</SurrealHostingExtensionsVersion>
<SurrealJsonVersion>1.0.4</SurrealJsonVersion>
<SurrealModelsVersion>1.0.4</SurrealModelsVersion>
<SurrealWsVersion>1.0.4</SurrealWsVersion>
<SurrealExtensionsServiceVersion>1.0.4</SurrealExtensionsServiceVersion>
<Version>1.0.4</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Driver/Rest/Rest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>REST based database driver for SurrealDB</Description>
<PackageVersion>$(SurrealDriverRestVersion)</PackageVersion>
<AssemblyName>SurrealDB.Driver.Rest</AssemblyName>
<PackageTags>surrealdb sql nosql database connector rest</PackageTags>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Driver/Rpc/Rpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Websocket RPC based database driver for SurrealDB</Description>
<PackageVersion>$(SurrealDriverRpcVersion)</PackageVersion>
<AssemblyName>SurrealDB.Driver.Rpc</AssemblyName>
<PackageTags>surrealdb sql nosql database connector websockets</PackageTags>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Extensions/Service/Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Service integration into the ASP.NET Core ecosystem.</Description>
<PackageVersion>$(SurrealExtensionsServiceVersion)</PackageVersion>
<AssemblyName>SurrealDB.Extensions.Service</AssemblyName>
<PackageTags>surrealdb sql nosql database connector websockets</PackageTags>
</PropertyGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/Json/Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>JSON utility for the SurrealDB driver</Description>
<PackageVersion>$(SurrealJsonVersion)</PackageVersion>
<AssemblyName>SurrealDB.Json</AssemblyName>
<PackageTags>surrealdb sql nosql database connector</PackageTags>
</PropertyGroup>
Expand All @@ -20,13 +19,13 @@
</ItemGroup>

<ItemGroup Condition="!$(DefineConstants.Contains('NET6_0_OR_GREATER'))">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0"/>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="6.0.6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion src/Models/Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Models for the SurrealDB driver</Description>
<PackageVersion>$(SurrealModelsVersion)</PackageVersion>
<AssemblyName>SurrealDB.Models</AssemblyName>
<PackageTags>surrealdb sql nosql database connector</PackageTags>
</PropertyGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/Ws/Ws.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<PropertyGroup Label="Nuget Pack Options">
<Description>Websocket utility for the SurrealDB driver</Description>
<PackageVersion>$(SurrealWsVersion)</PackageVersion>
<AssemblyName>SurrealDB.Ws</AssemblyName>
<PackageTags>surrealdb sql nosql database connector</PackageTags>
</PropertyGroup>
Expand All @@ -16,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\Json\Json.csproj" />
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\Json\Json.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 9fd0a67

Please sign in to comment.