Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Feb 26, 2024
1 parent 3671243 commit 59ec7a1
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Publish Nuget Packages
on:
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
release:
types:
- published # Run the workflow when a new GitHub release is published

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget

defaults:
run:
shell: pwsh

jobs:
create_nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

# Create the NuGet packages in the folder from the environment variable NuGetDirectory
- run: dotnet pack ./src/OneWare.Essentials/OneWare.Essentials.csproj --configuration Release --output ${{ env.NuGetDirectory }}

# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Workload Restore
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
31 changes: 31 additions & 0 deletions OneWare.Essentials.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneWare.Essentials", "src\OneWare.Essentials\OneWare.Essentials.csproj", "{02A8AB8A-C9AB-4272-8FE6-852DAABCE52C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{293AE003-B26A-4C68-90F1-A3FB68AC6111}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{594A19A2-C55B-4CB8-8C3D-0A9F2A6B5304}"
ProjectSection(SolutionItems) = preProject
build\props\Asmichi.ChildProcess.props = build\props\Asmichi.ChildProcess.props
build\props\Avalonia.Controls.ColorPicker.props = build\props\Avalonia.Controls.ColorPicker.props
build\props\Avalonia.Controls.DataGrid.props = build\props\Avalonia.Controls.DataGrid.props
build\props\Avalonia.Controls.PanAndZoom.props = build\props\Avalonia.Controls.PanAndZoom.props
build\props\Avalonia.Controls.TreeDataGrid.props = build\props\Avalonia.Controls.TreeDataGrid.props
build\props\Avalonia.props = build\props\Avalonia.props
build\props\Avalonia.Svg.props = build\props\Avalonia.Svg.props
build\props\Avalonia.Xaml.Interactions.props = build\props\Avalonia.Xaml.Interactions.props
build\props\AvaloniaEdit.props = build\props\AvaloniaEdit.props
build\props\AvaloniaEdit.TextMate.props = build\props\AvaloniaEdit.TextMate.props
build\props\CommunityToolkit.Mvvm.props = build\props\CommunityToolkit.Mvvm.props
build\props\Dock.Avalonia.props = build\props\Dock.Avalonia.props
build\props\Jint.props = build\props\Jint.props
build\props\OmniSharp.Extensions.Language.props = build\props\OmniSharp.Extensions.Language.props
build\props\Prism.Avalonia.props = build\props\Prism.Avalonia.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "actions", "actions", "{F97A8C36-9F34-418C-A109-F89CA179D661}"
ProjectSection(SolutionItems) = preProject
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
.github\workflows\test.yml = .github\workflows\test.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -13,4 +40,8 @@ Global
{02A8AB8A-C9AB-4272-8FE6-852DAABCE52C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02A8AB8A-C9AB-4272-8FE6-852DAABCE52C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{594A19A2-C55B-4CB8-8C3D-0A9F2A6B5304} = {293AE003-B26A-4C68-90F1-A3FB68AC6111}
{F97A8C36-9F34-418C-A109-F89CA179D661} = {293AE003-B26A-4C68-90F1-A3FB68AC6111}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions build/props/Avalonia.Desktop.props

This file was deleted.

3 changes: 1 addition & 2 deletions src/OneWare.Essentials/OneWare.Essentials.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\props\OmniSharp.Extensions.Language.props" />
<Import Project="..\..\build\props\Avalonia.props" />
<Import Project="..\..\build\props\Avalonia.Svg.props" />
<Import Project="..\..\build\props\Avalonia.Xaml.Interactions.props" />
<Import Project="..\..\build\props\Avalonia.Controls.ColorPicker.props"/>
<Import Project="..\..\build\props\Avalonia.Controls.DataGrid.props"/>
Expand All @@ -14,7 +15,6 @@
<Import Project="..\..\build\props\CommunityToolkit.Mvvm.props"/>
<Import Project="..\..\build\props\Asmichi.ChildProcess.props"/>


<PropertyGroup>
<Version>0.1</Version>
<Authors>Hendrik Mennen</Authors>
Expand All @@ -30,5 +30,4 @@
<LangVersion>latest</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

</Project>

0 comments on commit 59ec7a1

Please sign in to comment.