Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name-template: 'v$RESOLVED_VERSION'
name-template: 'Kepware.Api SDK v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
tag-prefix: 'Kepware.Api/'
commitish: refs/heads/main
version-resolver:
major:
Expand Down
33 changes: 33 additions & 0 deletions .github/syncservice-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name-template: 'Kepware SyncService v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
tag-prefix: 'SyncService/'
commitish: refs/heads/main
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
## Changes

$CHANGES
11 changes: 1 addition & 10 deletions .github/workflows/docfx-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@ name: Docfx Builder and Publisher for Web Pages
on:
workflow_dispatch:
push:
branches: [ "main" ]
branches: [ "test" ]
paths:
- 'Kepware.Api/**'
- 'Kepware.Api.Sample/**'
- 'KepwareSync.Service/**'
- 'docs/docfx/**'
- '.github/workflows/dotnet.yml'
# - '!**/*.md' Exclude markdown files
# pull_request:
# branches: [ "main" ]
# paths:
# - 'Kepware.Api/**'
# - 'Kepware.Api.Sample/**'
# - 'KepwareSync.Service/**'
# - '.github/workflows/dotnet.yml'
# - '!*.md' # Exclude markdown files

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Container Image

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'Kepware.Api/**'
# - 'Kepware.Api/**'
- 'KepwareSync.Service/**'
- '.github/workflows/docker-build-and-push.yml'
- '!**/*.md' # Exclude markdown files
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: .NET
name: SDK Build and Release

on:

workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'Kepware.Api/**'
- 'Kepware.Api.Sample/**'
- 'KepwareSync.Service/**'
# - 'KepwareSync.Service/**'
- '.github/workflows/dotnet.yml'
- '!**/*.md' # Exclude markdown files
pull_request:
branches: [ "main" ]
paths:
- 'Kepware.Api/**'
- 'Kepware.Api.Sample/**'
- 'KepwareSync.Service/**'
# - 'KepwareSync.Service/**'
- '.github/workflows/dotnet.yml'
- '!*.md' # Exclude markdown files

Expand All @@ -38,6 +38,7 @@ jobs:
- uses: dotnet/nbgv@master
id: nbgv
with:
path: ./Kepware.Api
setAllVars: true
- name: Use Release Drafter
if: ${{ github.event_name != 'pull_request' && matrix.platform == 'ubuntu' }}
Expand All @@ -64,8 +65,8 @@ jobs:
name: .NET 9 Test Report (${{ matrix.platform }})
path: "**/TestResults/**/*.trx"
reporter: dotnet-trx
- name: dotnet publish
run: dotnet publish KepwareSync.Service/Kepware.SyncService.csproj --configuration release -o publish /p:UseAppHost=true
# - name: dotnet publish
# run: dotnet publish KepwareSync.Service/Kepware.SyncService.csproj --configuration release -o publish /p:UseAppHost=true

- name: Push to GitHub Packages
if: ${{ github.event_name != 'pull_request' && matrix.platform == 'ubuntu' }}
Expand All @@ -74,26 +75,10 @@ jobs:
--api-key ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate \
--source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"

- name: Create and Upload Release Asset (Linux)
if: ${{ github.event_name != 'pull_request' && matrix.platform == 'ubuntu' }}
run: |
# Create the ZIP file with only the required files
zip -j Kepware.SyncService-linux-x64.zip \
$(find . -path '**/publish/Kepware.SyncService') \
$(find . -path '**/publish/Kepware.SyncService.dbg') \
$(find . -path '**/publish/appsettings.json')
# Upload the ZIP file
gh release upload v${{ steps.nbgv.outputs.SemVer2 }} Kepware.SyncService-linux-x64.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create and Upload Release Asset (Windows)
if: ${{ github.event_name != 'pull_request' && matrix.platform == 'windows' }}
run: |
# Create the ZIP file with only the required files
Compress-Archive -Path @(".\publish\Kepware.SyncService.exe",".\publish\Kepware.SyncService.pdb", ".\publish\appsettings.json") -DestinationPath Kepware.SyncService-win-x64.zip
# Upload the ZIP file
gh release upload v${{ steps.nbgv.outputs.SemVer2 }} Kepware.SyncService-win-x64.zip --clobber
# Upload the NuGet package
gh release upload ${{ steps.drafter.outputs.tag_name }} ./Kepware.Api/bin/Release/*.nupkg --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/syncservice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Sync Service Build and Release

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'KepwareSync.Service/**'
- '.github/workflows/syncservice.yml'
- '!**/*.md' # Exclude markdown files
pull_request:
branches: [ "main" ]
paths:
- 'KepwareSync.Service/**'
- '.github/workflows/syncservice.yml'
- '!**/*.md' # Exclude markdown files

jobs:
build:
strategy:
matrix:
platform: [windows, ubuntu]
runs-on: ${{ matrix.platform }}-latest
permissions:
contents: write
pull-requests: write
packages: write
actions: read
checks: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- uses: dotnet/nbgv@master
id: nbgv
with:
path: ./KepwareSync.Service
setAllVars: true
- name: Use Release Drafter
if: ${{ github.event_name != 'pull_request'}}
id: drafter
uses: release-drafter/release-drafter@v6
with:
config-name: syncservice-release-drafter.yml
version: ${{ steps.nbgv.outputs.SemVer2 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 ./KepwareSync.Service/Kepware.SyncService.csproj --no-restore --configuration release
- name: dotnet publish
run: dotnet publish ./KepwareSync.Service/Kepware.SyncService.csproj --configuration release -o publish /p:UseAppHost=true
- name: Create and Upload Release Asset (Linux)
if: ${{ github.event_name != 'pull_request' && matrix.platform == 'ubuntu' }}
run: |
# Create the ZIP file with only the required files
zip -j Kepware.SyncService-linux-x64.zip \
$(find . -path '**/publish/Kepware.SyncService') \
$(find . -path '**/publish/Kepware.SyncService.dbg') \
$(find . -path '**/publish/appsettings.json')
# Upload the ZIP file
gh release upload ${{ steps.drafter.outputs.tag_name }} Kepware.SyncService-linux-x64.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create and Upload Release Asset (Windows)
if: ${{ github.event_name != 'pull_request' && matrix.platform == 'windows' }}
run: |
# Create the ZIP file with only the required files
Compress-Archive -Path @(".\publish\Kepware.SyncService.exe",".\publish\Kepware.SyncService.pdb", ".\publish\appsettings.json") -DestinationPath Kepware.SyncService-win-x64.zip
# Upload the ZIP file
gh release upload ${{ steps.drafter.outputs.tag_name }} Kepware.SyncService-win-x64.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions Kepware.Api/KepwareApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public partial class KepwareApiClient : IKepwareDefaultValueProvider
public KepwareApiClient(KepwareApiClientOptions options, ILoggerFactory loggerFactory, HttpClient httpClient)
: this(UNKNOWN, options, loggerFactory, httpClient)
{
m_logger.LogInformation("Created KepwareApiClient instance with name {ClientName} at {BaseAddress}", ClientName, m_httpClient.BaseAddress);
m_logger.LogInformation("KepwareApiClient instance created successfully.");
}

internal KepwareApiClient(string name, KepwareApiClientOptions options, ILoggerFactory loggerFactory, HttpClient httpClient)
Expand Down
1 change: 1 addition & 0 deletions version.json → Kepware.Api/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0-beta",
"pathFilters": ["."],
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down
4 changes: 2 additions & 2 deletions KepwareSync.Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ static Task Main(string[] args)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables();

var configuration = cfgBuilder.Build();
builder.Configuration.AddConfiguration(configuration);

Console.WriteLine("Dumb stuff");
var app = new AppRunner(builder);

// Binder
Expand Down
17 changes: 17 additions & 0 deletions KepwareSync.Service/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0-beta",
"pathFilters": ["."],
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
},
"release": {
"tagName": "v{version}"
}
}
Loading