Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f7e7f00
Add job name
Invvard Jan 19, 2024
bb2ce14
Use sub workflow calls
Invvard Jan 20, 2024
c3ac6b4
Move Checkout repository step
Invvard Jan 20, 2024
b4cff08
Change extension
Invvard Jan 20, 2024
49589ff
Add file extension
Invvard Jan 20, 2024
ae81eda
Remove workflow call from steps
Invvard Jan 20, 2024
a051b70
Add release workflow
Invvard Jan 21, 2024
fec590b
Fix YAML extension
Invvard Jan 21, 2024
7966d2f
Update trigger rule
Invvard Jan 21, 2024
2084f51
Remove environment
Invvard Jan 21, 2024
e9e24de
Add Nuget metadata
Invvard Jan 22, 2024
18f5116
Add .nuspec files
Invvard Jan 22, 2024
2ecacf7
Update Nuget workflow
Invvard Jan 22, 2024
dd92892
Add checkout step
Invvard Jan 22, 2024
4ea643e
Filter csproj
Invvard Jan 22, 2024
9b16765
Create build props
Invvard Jan 22, 2024
ac088eb
WIP
Invvard Jan 23, 2024
2766bed
Move package metadata to csproj
Invvard Jan 23, 2024
9c27d4a
Reorganize build props
Invvard Jan 23, 2024
7c287e0
Add new configuration
Invvard Jan 23, 2024
3a7c370
Add NuGetDefaults.config
Invvard Jan 23, 2024
dfdc060
Update dotnet commands
Invvard Jan 23, 2024
bdb0617
Update jobs
Invvard Jan 23, 2024
5d79cd0
Update workflow
Invvard Jan 24, 2024
a416bb6
Use $GITHUB_WORKSPACE
Invvard Jan 24, 2024
0ee0fb6
Update Checkout action
Invvard Jan 24, 2024
a596d7b
Simplify conditions
Invvard Jan 24, 2024
9bfd03f
Add workaround
Invvard Jan 24, 2024
f290cd6
Disable Nuget local source
Invvard Jan 24, 2024
e2b104f
Remove build configuration Pipeline
Invvard Jan 24, 2024
9f95bbf
Remove default Nuget config
Invvard Jan 24, 2024
d4b5d7e
Upload artifacts
Invvard Jan 24, 2024
3d1c46b
Remove Pipeline build configuration
Invvard Jan 25, 2024
88c75d8
WIP
Invvard Jan 25, 2024
1fa2a33
Refactor props and csproj
Invvard Jan 26, 2024
70ec5a8
Use Nuget Package
Invvard Jan 27, 2024
5bd4e43
Nuget Push activation
Invvard Jan 27, 2024
4df3ba9
Remove sample projects from solution
Invvard Jan 27, 2024
95bcfc3
Create a Samples solution
Invvard Jan 27, 2024
2b261f1
Add api key to command
Invvard Jan 27, 2024
2c128bf
Fix deployment
Invvard Jan 27, 2024
43b4db8
Add dispatch inputs
Invvard Jan 28, 2024
2efb1d7
Remove push event
Invvard Jan 28, 2024
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
12 changes: 12 additions & 0 deletions .github/workflows/dotnet-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: .NET CI

on:
push:
branches: [ "feature/*" ]
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, closed]

jobs:
build_and_test:
uses: ./.github/workflows/dotnet-job-build-test.yaml
33 changes: 33 additions & 0 deletions .github/workflows/dotnet-job-build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build & Test
run-name: Build & Test

on:
workflow_call:
inputs:
buildConfiguration:
description: 'Build Configuration'
type: string
default: 'Release'

jobs:
build-project:
name: Build Project & Test
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration ${{ inputs.buildConfiguration }}

- name: Test
run: dotnet test --no-build --verbosity normal --configuration ${{ inputs.buildConfiguration }}
46 changes: 46 additions & 0 deletions .github/workflows/dotnet-job-publish-nuget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: NuGet Publish

on:
workflow_call:
inputs:
push_package:
type: boolean
default: false
build_configuration:
description: 'Build Configuration'
type: string
default: 'Release'
version_suffix:
description: 'Version Suffix'
type: string
default: ''
secrets:
nuget_api_key:
description: 'NuGet API Key'
required: true

jobs:
publish-nuget:
name: Publish NuGet Package
runs-on: ubuntu-latest
env:
package_path: nupkgs

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Pack
run: dotnet pack $GITHUB_WORKSPACE/InvvardDev.Ifttt.sln --output ${{ env.package_path }} --configuration ${{ inputs.build_configuration }} -p:GeneratePackageOnBuild=false

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ${{ env.package_path }}

- name: Publish to NuGet
if: inputs.push_package
run: dotnet nuget push ${{ env.package_path }}/*.* --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key $nuget_api_key
env:
nuget_api_key: ${{ secrets.nuget_api_key }}
50 changes: 50 additions & 0 deletions .github/workflows/dotnet-prerelease-pack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Create pre-release NuGet package
run-name: Create pre-release NuGet package

on:
workflow_dispatch:
inputs:
push_package:
description: 'Push package to NuGet.org'
type: boolean
default: false
version_suffix:
description: 'Version suffix'
type: choice
default: 'alpha'
options:
- 'alpha'
- 'beta'
- 'rc'
version_custom:
description: 'Custom version suffix or version suffix index'
type: string
required: true
default: '1'

jobs:
setup_env:
name: Setup environment
runs-on: ubuntu-latest

outputs:
version_suffix: ${{ steps.set_version_suffix.outputs.version_suffix }}

steps:
- name: sets env var version_suffix
if: github.event_name == 'workflow_dispatch'
id: set_version_suffix
run: echo "version_suffix=${{ format('{0}{1}', github.event.inputs.version_suffix, github.event.inputs.version_custom) }}" >> "$GITHUB_OUTPUT"

build_and_test:
uses: ./.github/workflows/dotnet-job-build-test.yaml

publish_nuget:
needs: [build_and_test, setup_env]
uses: ./.github/workflows/dotnet-job-publish-nuget.yaml
with:
push_package: ${{ github.event.inputs.push_package }}
version_suffix: ${{ needs.setup_env.outputs.version_suffix }}
secrets:
nuget_api_key: ${{ secrets.NUGET_API_KEY_TEST }}

13 changes: 13 additions & 0 deletions .github/workflows/dotnet-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: .NET Release

on:
push:
branches: [ "release/*" ]

jobs:
publish_nuget:
uses: ./.github/workflows/dotnet-job-publish-nuget.yaml
with:
push_package: true
secrets:
nuget_api_key: ${{ secrets.NUGET_API_KEY_TEST }}
28 changes: 0 additions & 28 deletions .github/workflows/dotnet.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
Expand Down
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
9 changes: 0 additions & 9 deletions InvvardDev.Ifttt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvvardDev.Ifttt.Trigger",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8217D2BC-C98F-444C-B8D7-47CB074F6A66}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{D3D189E6-DB32-4E25-ACEE-A253B03C7281}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvvardDev.Ifttt.Trigger.UpdatedNuget", "sample\InvvardDev.Ifttt.Trigger.UpdatedNuget\InvvardDev.Ifttt.Trigger.UpdatedNuget.csproj", "{15680BDC-86C0-4810-87A4-02200D01CFC4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvvardDev.Ifttt.Trigger.Tests", "tests\InvvardDev.Ifttt.Trigger.Tests\InvvardDev.Ifttt.Trigger.Tests.csproj", "{F94D7981-BB31-467B-AA87-8924964CA186}"
EndProject
Global
Expand All @@ -29,10 +25,6 @@ Global
{7A94E577-6B7C-4AC5-A602-01FC41ED4D84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A94E577-6B7C-4AC5-A602-01FC41ED4D84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A94E577-6B7C-4AC5-A602-01FC41ED4D84}.Release|Any CPU.Build.0 = Release|Any CPU
{15680BDC-86C0-4810-87A4-02200D01CFC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15680BDC-86C0-4810-87A4-02200D01CFC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15680BDC-86C0-4810-87A4-02200D01CFC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15680BDC-86C0-4810-87A4-02200D01CFC4}.Release|Any CPU.Build.0 = Release|Any CPU
{F94D7981-BB31-467B-AA87-8924964CA186}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F94D7981-BB31-467B-AA87-8924964CA186}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F94D7981-BB31-467B-AA87-8924964CA186}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -45,7 +37,6 @@ Global
SolutionGuid = {61C7BA3B-15B1-46EE-9471-EEA384386D41}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{15680BDC-86C0-4810-87A4-02200D01CFC4} = {D3D189E6-DB32-4E25-ACEE-A253B03C7281}
{F94D7981-BB31-467B-AA87-8924964CA186} = {8217D2BC-C98F-444C-B8D7-47CB074F6A66}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Invvard
Copyright (c) 2024 Pierre Cavaroc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content upcoming soon...
10 changes: 10 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Project Packages" value="./packages/" />
</packageSources>
<disabledPackageSources>
<add key="Project Packages" value="true" />
</disabledPackageSources>
</configuration>
16 changes: 16 additions & 0 deletions samples/InvvardDev.Ifttt.Samples.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvvardDev.Ifttt.Trigger.UpdatedNuget", "InvvardDev.Ifttt.Trigger.UpdatedNuget\InvvardDev.Ifttt.Trigger.UpdatedNuget.csproj", "{8A6E23C3-C46C-4566-AEC6-B7B8BE149F8F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8A6E23C3-C46C-4566-AEC6-B7B8BE149F8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A6E23C3-C46C-4566-AEC6-B7B8BE149F8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A6E23C3-C46C-4566-AEC6-B7B8BE149F8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A6E23C3-C46C-4566-AEC6-B7B8BE149F8F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="InvvardDev.Ifttt.Trigger" Version="0.1.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
</ItemGroup>
Expand All @@ -18,8 +17,4 @@
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\InvvardDev.Ifttt.Trigger\InvvardDev.Ifttt.Trigger.csproj" />
</ItemGroup>

</Project>
53 changes: 53 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<Project>

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>12</LangVersion>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Label="Nuget Specs">
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageId>$(AssemblyName)</PackageId>

<VersionPrefix>0.1.0</VersionPrefix>
<PackageVersion>$(Version)</PackageVersion>

<Authors>Pierre Cavaroc</Authors>
<Copyright>Copyright (c) Pierre Cavaroc 2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Invvard/InvvardDev.IFTTT.NET</PackageProjectUrl>
<PackageTags>ifttt triggers actions queries</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/Invvard/InvvardDev.IFTTT.NET.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>
Introducing IFTTT.NET, your C# toolkit for painless IFTTT integrations.
Forget the boilerplate code and focus on your Trigger, Query, and Action logic.
Simplify your development without the unnecessary fuss.
</Description>
</PropertyGroup>

<PropertyGroup Condition=" $(Configuration) == 'Debug' ">
<VersionSuffix>dev</VersionSuffix>
<SymbolPackageOutputPath>$(SolutionDir)packages</SymbolPackageOutputPath>
<PackageOutputPath>$(SolutionDir)packages</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/InvvardDev.Ifttt.Core/Configuration/IftttOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ public class IftttOptions
public const string DefaultSectionName = nameof(IftttOptions);

[Required]
#if NET7_0_OR_GREATER
public required string ServiceKey { get; init; } = string.Empty;
#else
public string ServiceKey { get; init; } = string.Empty;
#endif

public bool BypassServiceKey { get; init; } = false;

Expand Down
14 changes: 14 additions & 0 deletions src/InvvardDev.Ifttt.Core/Configuration/SnakeCaseNamingPolicy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#if NET6_0 || NET7_0

using System.Text.Json;

namespace InvvardDev.Ifttt.Core.Configuration;

public class SnakeCaseNamingPolicy : JsonNamingPolicy
{
public static SnakeCaseNamingPolicy SnakeCaseLower { get; } = new();

public override string ConvertName(string name) => name.ToSnakeCase();
}

#endif
Loading