Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/GitHub workflow #7

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
pull_request:
branches: [ develop ]

jobs:
Build:

env:
SOLUTION: 'iCL.DocumentConverter.sln'
BUILD_CONFIG: 'Release'

runs-on: [windows-latest]

steps:
- uses: actions/checkout@v2

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Restore NuGet packages
run: nuget restore $SOLUTION

# - name: Get Git Version
# run: |
# dotnet tool install --global GitVersion.Tool --version 5.*
# dotnet-gitversion
# $json=dotnet-gitversion | ConvertFrom-Json
# echo "BUILD_VERSION=$json.SemVer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
# shell: pwsh

- name: Build the Solution
run: msbuild $SOLUTION /p:Configuration=$env:BUILD_CONFIG /p:Version=1.0.0 #$env:BUILD_VERSION

- name: Archive
uses: actions/upload-artifact@v2
with:
name: DocumentConverter.Plugin.nuget
path: ./src/DocumentPicker.Plugin/bin/Release/*.nupkg

# - name: Tag
# run: git tag $BUILD_VERSION

# - name: Tag Push
# run: git --tag push

# - name: Publish
# run: nuget push ./src/DocumentPicker.Plugin/bin/Release/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ develop ]

jobs:
Build:
runs-on: [windows-latest]

env:
SOLUTION: 'iCL.DocumentConverter.sln'

steps:
- uses: actions/checkout@v2
with:
dotnet-version: 6.0.x

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Restore NuGet packages
run: nuget restore $SOLUTION

- name: Execute unit tests
run: dotnet test .\tests\DocumentConverter.Tests\ --no-restore
2 changes: 1 addition & 1 deletion src/DocumentPicker.IOS/DocumentPicker.IOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Svg">
<PackageReference Include="Predjeskovic.Test.Svg">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

<Version>2.4.3.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
Expand Down
12 changes: 8 additions & 4 deletions src/DocumentPicker.Plugin/DocumentConverter.Plugin.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;MonoAndroid90;Xamarin.iOS10;uap10.0.17763</TargetFrameworks>
<PackageId>Optiq.DocumentConverter.PdfToSvg</PackageId>
<Version Condition="'$(Version)' == ''">1.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="$(Configuration) == 'Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PdfToSvg.NET" Version="0.7.0" />
<PackageReference Include="Svg" Version="2.4.3.5" />
<PackageReference Include="Predjeskovic.Test.Svg" Version="2.4.3.5" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>

Expand All @@ -18,8 +24,6 @@
<ItemGroup Condition=" $(TargetFramework.StartsWith('uap')) ">
<Compile Include="Platforms\UniversalWindows\**\*.cs" />

<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" />

<Folder Include="Platforms\UniversalWindows\" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/DocumentPicker.Sample/DocumentPicker.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Svg" Version="2.4.3.5" />
<PackageReference Include="Predjeskovic.Test.Svg" Version="2.4.3.5" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
Expand Down
2 changes: 1 addition & 1 deletion src/DocumentPicker.UWP/DocumentPicker.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.14</Version>
</PackageReference>
<PackageReference Include="Svg">
<PackageReference Include="Predjeskovic.Test.Svg">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

<Version>2.4.3.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="Svg" Version="2.4.3.5" />
<PackageReference Include="Predjeskovic.Test.Svg" Version="2.4.3.5" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Predjeskovic.Test.Svg" Version="2.4.3.5" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="Svg" Version="2.4.3.5" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.FFImageLoading" Version="2.4.11.982" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using DocumentConverter.Plugin.Shared;
using DocumentConverter.Plugin.Shared.Picker;
using DocumentConverter.Plugin.Shared.StreamProvider;
using Moq;
using Shouldly;
using Svg;

Expand Down