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
52 changes: 35 additions & 17 deletions .github/workflows/nuget-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,47 @@ jobs:
- name: Pack
shell: bash
run: |
dotnet pack --include-symbols /p:PackageVersion="$PACKAGE_VERSION" /p:AssemblyVersion="$ASSEMBLY_VERSION" /p:FileVersion="$FILE_VERSION"
dotnet pack /p:PackageVersion="$PACKAGE_VERSION" /p:AssemblyVersion="$ASSEMBLY_VERSION" /p:FileVersion="$FILE_VERSION"

- name: Upload packages to build artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: src/artifacts/package/release/*nupkg

# Not using the GitHub package registry right now, since it doesn't allow anonymous access so it's a hassle to use
- name: Publish package to NuGet.org
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
shell: bash
run: |
shopt -s nullglob
packages=(src/artifacts/package/release/*.nupkg)
symbols=(src/artifacts/package/release/*.snupkg)

# - name: Publish package to GitHub
# if: github.event_name == 'pull_request' || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads'))
# shell: bash
# run: |
# dotnet nuget push "src/artifacts/package/release/*.symbols.nupkg" -s https://nuget.pkg.github.com/sillsdev/index.json -k "$NUGET_API_KEY" --skip-duplicate
# env:
# NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}
if ((${`#packages`[@]} == 0)); then
echo "No NuGet packages were produced." >&2
exit 1
fi
if ((${`#symbols`[@]} == 0)); then
echo "No symbol packages were produced." >&2
exit 1
fi

# - name: Publish package to NuGet.org
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# shell: bash
# run: |
# echo Would run the following:
# echo dotnet nuget push "src/artifacts/package/release/*nupkg" --skip-duplicate --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
# env:
# NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}
for pkg in "${packages[@]}"; do
case "$pkg" in
*.symbols.nupkg|*.snupkg) continue ;;
Comment thread
hahn-kev marked this conversation as resolved.
esac
echo "Publishing $pkg"
dotnet nuget push "$pkg" \
--skip-duplicate \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json
done
for sym in "${symbols[@]}"; do
echo "Publishing symbols $sym"
dotnet nuget push "$sym" \
--skip-duplicate \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json
done
Comment thread
hahn-kev marked this conversation as resolved.
env:
NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# harmony

[![NuGet version](https://img.shields.io/nuget/v/SIL.Harmony.svg?style=flat-square)](https://www.nuget.org/packages/SIL.Harmony/)

A CRDT application library for C#, use it to build offline first applications.

## Install
Expand Down
1 change: 1 addition & 0 deletions harmony.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{321635F9-11D9-4B45-A2F8-F3B70E9A4196}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
src\.editorconfig = src\.editorconfig
EndProjectSection
EndProject
Expand Down
19 changes: 19 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>
<PropertyGroup Condition="'$(IsPackable)' == 'true'">
<Authors>SIL Global</Authors>
<Company>SIL Global</Company>
<Copyright>Copyright © SIL Global</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sillsdev/harmony</PackageProjectUrl>
<RepositoryUrl>https://github.com/sillsdev/harmony</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>CRDT;offline-first;Entity Framework Core;synchronization;collaboration</PackageTags>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(MSBuildThisFileDirectory)../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/SIL.Harmony.Core/SIL.Harmony.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<RootNamespace>SIL.Harmony.Core</RootNamespace>
<IsPackable>true</IsPackable>
<Description>Core types and interfaces for the Harmony CRDT library.</Description>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="SIL.Harmony"/>
Expand Down
2 changes: 2 additions & 0 deletions src/SIL.Harmony.Linq2db/SIL.Harmony.Linq2db.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<RootNamespace>SIL.Harmony.Linq2db</RootNamespace>
<IsPackable>true</IsPackable>
<Description>linq2db integration for the Harmony CRDT library.</Description>
<PackageTags>$(PackageTags);linq2db</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/SIL.Harmony/SIL.Harmony.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<RootNamespace>SIL.Harmony</RootNamespace>
<IsPackable>true</IsPackable>
<Description>CRDT application library for building offline-first apps with Entity Framework Core.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading