Skip to content
Merged
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
103 changes: 103 additions & 0 deletions .github/workflows/deploy-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
- release/*

jobs:
build:
env:
BUILD_CONFIG: "Release"
SOLUTION: "FlipView.sln"
PROJECT: "FlipView.csproj"
BUILD_VERSION: "1.0.0"
#TEST_PROJECT: "../Test/Test.csproj"

runs-on: windows-latest
defaults:
run:
working-directory: ./src

steps:
- uses: actions/checkout@v2

- name: Check branch
run: |
echo commit message: '${{ github.event.head_commit.message }}'
echo Branch: '${{ github.ref }}'
echo Action: '${{ github.event_name }}'

- name: Check merge commit (only executed if merge is badly formed)
if: startsWith(github.ref, 'refs/heads/main') && (!contains(github.event.head_commit.message, 'Merge pull request ') || !contains(github.event.head_commit.message,'release/'))
run: |
echo INVALID COMMIT RELEASE MESSAGE: '${{ github.event.head_commit.message }}'
exit 1

- uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
if: startsWith(github.ref, 'refs/heads/main') && contains(github.event.head_commit.message, 'Merge pull request ') && contains(github.event.head_commit.message,'release/')
id: GetBuildVersion # Remember to give an ID if you need the output filename
name: Download GetBuildVersion.psm1
with:
url: "https://raw.githubusercontent.com/Jon2G/GetBuildVersion/refs/heads/main/GetBuildVersion.psm1"
target: src/
filename: GetBuildVersion.psm1

- name: GetBuildVersion.psm1
if: startsWith(github.ref, 'refs/heads/main') && contains(github.event.head_commit.message, 'Merge pull request ') && contains(github.event.head_commit.message,'release/')
run: |
$HEAD_COMMIT = "${{github.event.head_commit.message}}"
Import-Module .\GetBuildVersion.psm1
$version = GetBuildVersion -VersionString $HEAD_COMMIT
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo Version: $version
shell: pwsh

- name: Setup NuGet
if: startsWith(github.ref, 'refs/heads/main') && contains(github.event.head_commit.message, 'Merge pull request ') && contains(github.event.head_commit.message,'release/')
uses: NuGet/setup-nuget@v2

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

- name: Install .NET MAUI
run: |
dotnet workload install maui-tizen
dotnet workload install maui-android

- name: Restore dependencies
run: dotnet restore $SOLUTION

- name: Build project
run: dotnet build ${{env.PROJECT}} /p:Configuration=${{env.BUILD_CONFIG}} /p:Platform="Any CPU" /p:Version=${{env.BUILD_VERSION}}

- name: Build solution
run: dotnet build ${{env.SOLUTION}} /p:Configuration=${{env.BUILD_CONFIG}} /p:Platform="Any CPU" /p:Version=${{env.BUILD_VERSION}}

#- name: Run unit tests with report
# run: dotnet test $TEST_PROJECT --configuration Release --no-build --logger "trx;LogFileName=./../../src/TestResults.trx"

- name: Show files
run: ls

# - name: Upload test results
# uses: actions/upload-artifact@v4
# with:
# name: TestResults
# path: ./TestResults.trx

- name: Publish package
if: startsWith(github.ref, 'refs/heads/main') && contains(github.event.head_commit.message, 'Merge pull request ') && contains(github.event.head_commit.message,'release/')
run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate

- name: Publish symbols package
if: startsWith(github.ref, 'refs/heads/main') && contains(github.event.head_commit.message, 'Merge pull request ') && contains(github.event.head_commit.message,'release/')
run: dotnet nuget push **\*.snupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate
8 changes: 6 additions & 2 deletions Test/FlipViewTest/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
namespace FlipViewTest

namespace FlipViewTest
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}

MainPage = new AppShell();
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell());
}
}
}
13 changes: 6 additions & 7 deletions Test/FlipViewTest/FlipViewTest.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

Expand Down Expand Up @@ -57,14 +57,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FlipView-MAUI" Version="1.0.1" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.30" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.30" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
<!--<ProjectReference Include="..\..\src\FlipView.csproj" />-->
<ProjectReference Include="..\..\src\FlipView.csproj" />
</ItemGroup>

</Project>
Binary file added nuget_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 23 additions & 10 deletions src/FlipView.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-maccatalyst;net6.0-android;net7.0-android;net8.0-android;net8.0-ios;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;net8.0-windows10.0.19041.0;</TargetFrameworks>
<TargetFrameworks>net6.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net7.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net8.0;net8.0-maccatalyst;net8.0-android;net8.0-ios</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net9.0;net9.0-maccatalyst;net9.0-android;net9.0-ios</TargetFrameworks>

<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>-->

<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
Expand Down Expand Up @@ -37,22 +43,29 @@
Insipired by Expander Control and https://github.com/devcrux/Flip-Animation-in-Xamarin.Forms
</Description>
<Copyright>none</Copyright>
<Version>1.0.5</Version>
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />-->
<Version>1.0.0</Version>
<PackageIcon>nuget_icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AsyncAwaitBestPractices" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\nuget_icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Platforms\Android\" />
<Folder Include="Platforms\MacCatalyst\" />
<Folder Include="Platforms\Windows\" />
<Folder Include="Platforms\Android\" />
<Folder Include="Platforms\MacCatalyst\" />
<Folder Include="Platforms\Windows\" />
</ItemGroup>

</Project>
8 changes: 3 additions & 5 deletions FlipView.sln → src/FlipView.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlipView", "src\FlipView.csproj", "{800AA4C7-F224-4DEC-8233-E1BFFEC86D85}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlipView", "FlipView.csproj", "{800AA4C7-F224-4DEC-8233-E1BFFEC86D85}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{F14F8CA8-0B91-466D-8E1B-6E2CA7DA6FA1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlipViewTest", "Test\FlipViewTest\FlipViewTest.csproj", "{0334654D-0993-4613-8EFD-B550B17D852D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E7986880-1ACF-49FA-9342-BE3B84F2E66C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlipViewTest", "..\Test\FlipViewTest\FlipViewTest.csproj", "{0334654D-0993-4613-8EFD-B550B17D852D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7DCA261F-1F0D-4E72-A086-EF50C5B4F90C}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
..\nuget_icon.png = ..\nuget_icon.png
README.md = README.md
sample.gif = sample.gif
EndProjectSection
Expand Down Expand Up @@ -75,7 +74,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{800AA4C7-F224-4DEC-8233-E1BFFEC86D85} = {E7986880-1ACF-49FA-9342-BE3B84F2E66C}
{0334654D-0993-4613-8EFD-B550B17D852D} = {F14F8CA8-0B91-466D-8E1B-6E2CA7DA6FA1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down