Skip to content

Commit

Permalink
Migrated the library to Uno 5.1 and .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
xperiandri committed Mar 28, 2024
1 parent d8c3e19 commit bf065d8
Show file tree
Hide file tree
Showing 25 changed files with 410 additions and 501 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/publish_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish to MyGet

on:
push:
branches:
- uno

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

jobs:
build:

runs-on: windows-2022

steps:

- name: Check-out
uses: actions/checkout@v4

- name: Set Build Version
run: |
cd src/Elmish.Uno
$version = "$env:GITHUB_REF_NAME".Substring("releases/".Length)
$File = (
Select-Xml -XPath "/Project/PropertyGroup[@Label='NuGet']/Version" -Path Elmish.Uno.fsproj
)[0].Node
$File.InnerText = $version
$File.OwnerDocument.Save((Join-Path $PWD.ProviderPath Elmish.Uno.fsproj))
echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

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

- name: Add the GitHub and MyGet sources
run: |
dotnet nuget add source --username USERNAME --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text --name "github.com" "https://nuget.pkg.github.com/fsprojects/index.json"
dotnet nuget add source --username USERNAME --password ${{secrets.MYGET_TOKEN}} --store-password-in-clear-text --name "myget.org" "https://www.myget.org/F/elmish_uno/api/v3/index.json"
- name: Install local tools
run: dotnet tool restore

- name: Restore NuGet packages
run: dotnet restore Elmish.Uno.sln

- name: Build
run: dotnet build --no-restore Elmish.Uno.sln --configuration Release -maxcpucount

- name: Test
run: dotnet test --no-build --configuration Release src/Elmish.Uno.Tests/Elmish.Uno.Tests.fsproj

- name: Pack
run: |
cd src/Elmish.Uno
dotnet pack --no-build --configuration Release /p:ContinuousIntegrationBuild=true -o ../../nuget
- name: Publish to MyGet
run: |
dotnet nuget push nuget/Elmish.Uno.${{env.VERSION}}.{nupkg,snupkg} -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
dotnet nuget push nuget/Elmish.Uno.${{env.VERSION}}.{nupkg,snupkg} -s "myget.org" -k ${{secrets.MYGET_SECRET}} --skip-duplicate
59 changes: 0 additions & 59 deletions .github/workflows/publish_myget.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/publish_nuget.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish to NuGet

on:
push:
tags:
- 'releases/*'

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

jobs:
build:

runs-on: windows-2022

steps:

- name: Check-out
uses: actions/checkout@v4
with:
# This is necessary so that we have the tags.
fetch-depth: 0

- name: Set Build Version
run: |
$version = "$env:GITHUB_REF_NAME".Substring("releases/".Length)
$File = (
Select-Xml -XPath "/Project/PropertyGroup[@Label='NuGet']/Version" -Path "src\Elmish.Uno\Elmish.Uno.fsproj"
)[0].Node
$File.InnerText = $version
$File.OwnerDocument.Save((Join-Path $PWD.ProviderPath "src\Elmish.Uno\Elmish.Uno.fsproj"))
echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

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

- name: Install local tools
run: dotnet tool restore

- name: Restore NuGet packages
run: dotnet restore Elmish.Uno.sln

- name: Build
run: dotnet build --no-restore Elmish.Uno.sln --configuration Release -maxcpucount

- name: Test
run: dotnet test --no-build --configuration Release src/Elmish.Uno.Tests/Elmish.Uno.Tests.fsproj

- name: Pack
run: |
cd src/Elmish.Uno
dotnet pack --no-build --configuration Release /p:ContinuousIntegrationBuild=true -o ../../nuget
- name: Publish to NuGet
run: |
dotnet nuget push nuget/Elmish.Uno.${{env.VERSION}}.{nupkg,snupkg} -s "nuget.org" -k ${{secrets.NUGET_SECRET}} --skip-duplicate
35 changes: 19 additions & 16 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,37 @@ on:
- opened
- synchronize

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

jobs:
build:

runs-on: windows-2022
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dotnet: [8.0.202]
runs-on: ${{ matrix.os }}

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install .NET SDK 6.0.x
uses: actions/setup-dotnet@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: ${{ matrix.dotnet }}

- name: Install MSBuild
uses: microsoft/[email protected]
with:
#vs-version: '[17.0,)'
vs-prerelease: true
msbuild-architecture: x64
- name: Install local tools
run: dotnet tool restore

- name: Restore NuGet packages
run: nuget restore 'src\\Elmish.Uno.sln' -ConfigFile 'NuGet.Config'
run: dotnet restore Elmish.Uno.sln

- name: Build with MSBuild
run: |
msbuild 'src\\Elmish.Uno.sln' /t:Rebuild /p:Configuration=Release /p:Platform='Any CPU' -p:TargetFramework=net6.0-windows10.0.22000.0 -maxcpucount
msbuild 'src\\Elmish.Uno.sln' /t:Rebuild /p:Configuration=Release /p:Platform='Any CPU' -p:TargetFramework=net6.0 -maxcpucount
- name: Build
run: dotnet build --no-restore Elmish.Uno.sln --configuration Release -maxcpucount

- name: Test
run: dotnet test --no-build --configuration Release src/Elmish.Uno.Tests/Elmish.Uno.Tests.fsproj
55 changes: 0 additions & 55 deletions Elmish.Uno.nuspec

This file was deleted.

Loading

0 comments on commit bf065d8

Please sign in to comment.