Skip to content

Commit

Permalink
Merge pull request #2 from ahsanaman92/workflowsCIAndRelease
Browse files Browse the repository at this point in the history
Create CI.yml
  • Loading branch information
ahsanaman92 committed Mar 21, 2024
2 parents 302180d + c5c662b commit 64ffdcb
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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: CI

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

jobs:
build:

runs-on: windows-latest
env:
DOTNET_NOLOGO: true

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore JpegXmpWritePluginMDE.sln
- name: Build
run: dotnet build JpegXmpWritePluginMDE.sln --configuration Release
- name: Test net8.0
run: dotnet test --verbosity normal --configuration Release --no-build -f net8.0 JpegXmpWritePluginMDE.Tests\JpegXmpWritePluginMDE.Tests.csproj
20 changes: 20 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: prerelease
on:
release:
types: [prereleased]

jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Get version from release
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"
shell: bash
- run: echo ${{ steps.get_version.outputs.VERSION }}
- run: dotnet pack JpegXmpWritePluginMDE/JpegXmpWritePluginMDE.csproj -o . -c Release /p:Version=${{ steps.get_version.outputs.VERSION }}
- run: dotnet nuget push *.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NuGetAPIKey }}
shell: bash
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release
on:
release:
types: [published]

jobs:
windows:
runs-on: windows-latest
if: "!github.event.release.prerelease"
steps:
- uses: actions/checkout@v4
- name: Get version from release
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"
shell: bash
- run: echo ${{ steps.get_version.outputs.VERSION }}
- run: dotnet pack JpegXmpWritePluginMDE/JpegXmpWritePluginMDE.csproj -o . -c Release /p:Version=${{ steps.get_version.outputs.VERSION }}
- run: dotnet nuget push *.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NuGetAPIKey }}
shell: bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vs
bin
obj
artifacts
26 changes: 26 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- common NuGet package settings-->
<PropertyGroup>
<Authors>Michael Osthege;Ahsan Cheema</Authors>
<PackageProjectUrl>https://github.com/ahsanaman92/JpegXmpWritePluginMDE</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ahsanaman92/JpegXmpWritePluginMDE.git</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSource>true</IncludeSource>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<!-- common build properties -->
<PropertyGroup>
<VersionNumber Condition=" '$(Version)'=='' ">2.9.0</VersionNumber>
<NuGetAudit>enable</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
<UseArtifactsOutput>true</UseArtifactsOutput>
<WarningLevel>5</WarningLevel>
</PropertyGroup>

</Project>
13 changes: 12 additions & 1 deletion JpegXmpWritePluginMDE/JpegXmpWritePluginMDE.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

<Description>Plugin to metadata-extractor-dotnet (MDE) for writing XMP data to .jpg/.jpeg files</Description>
<AssemblyTitle>Jpg XMP Write Plugin for MDE</AssemblyTitle>
<PackageTags>XMP;Metadata;Writer;DotNet</PackageTags>
<Version>$(VersionNumber)</Version>
<SignAssembly>true</SignAssembly>
<!--<PublicSign>true</PublicSign>-->
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All"/>
Expand Down

0 comments on commit 64ffdcb

Please sign in to comment.