Skip to content

Commit

Permalink
Fix workflow (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitii authored Feb 6, 2022
1 parent 1ce5cb9 commit d57c527
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 29 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Auto approve

on:
pull_request_target
pull_request_target:
types: [opened]

jobs:
auto-approve:
runs-on: ubuntu-latest
steps:
- uses: hmarr/auto-approve-action@v2
if: github.actor == 'Gitii'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: hmarr/auto-approve-action@v2
if: github.actor == 'Gitii'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
vs-version: 17
vs-prerelease: true
- name: Setup VSTest Path
uses: darenm/Setup-VSTest@v1
- name: Build
run: dotnet build --configuration Release
run: msbuild /t:build -restore /p:Configuration=Release -m:4 Community.Sextant.WinUI.sln
- name: Test
run: dotnet test --configuration Release --no-build
run: Get-ChildItem -Recurse -Filter "*.Tests.dll" | ? { $_.FullName -Match "bin[\\/]Release" -and $_.FullName -notmatch "ref" } | % { vstest.console.exe $_.FullName }
25 changes: 16 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
publish:
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: olegtarasov/[email protected]
id: tagName
Expand All @@ -20,26 +20,33 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
include-prerelease: true
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
vs-version: 17
vs-prerelease: true
- name: Setup VSTest Path
uses: darenm/Setup-VSTest@v1
- name: Build
run: dotnet build -p:Configuration=Release -p:Version="$env:TAG_NAME"
run: msbuild /t:build -restore /p:Configuration=Release /p:Version="$env:TAG_NAME" -m:4 Community.Sextant.WinUI.sln
env:
TAG_NAME: ${{ steps.tagName.outputs.tag }}
- name: Test
run: dotnet test -p:Configuration=Release --no-build
run: Get-ChildItem -Recurse -Filter "*.Tests.dll" | ? { $_.FullName -Match "bin[\\/]Release" -and $_.FullName -notmatch "ref" } | % { vstest.console.exe $_.FullName }
- name: Pack
run: dotnet pack -p:Configuration=Release -o "$(Join-Path $(Get-Location) nuget)" /p:Version="$env:TAG_NAME" --no-build
run: msbuild /t:pack /p:Configuration=Release /p:OutputPath="$(Join-Path $(Get-Location) nuget)" /p:Version="$env:TAG_NAME" -m:1 ./Community.Sextant.WinUI.sln
env:
TAG_NAME: ${{ steps.tagName.outputs.tag }}
- name: Attach nuget packages to Github releases
uses: softprops/action-gh-release@v1
with:
files: "./nuget/*.nupkg"
body_path: "./RELEASE-NOTES.txt"
#- name: Push packages to Nuget registry
# run: dotnet nuget push $(Get-ChildItem -Path ./nuget -Filter "*.nupkg").FullName --source "https://api.nuget.org/v3/index.json" --api-key "$env:NUGET_API_KEY" --skip-duplicate --no-symbols 1
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
- name: Push packages to Nuget registry
run: dotnet nuget push $(Get-ChildItem -Path ./nuget -Filter "*.nupkg").FullName --source "https://api.nuget.org/v3/index.json" --api-key "$env:NUGET_API_KEY" --skip-duplicate --no-symbols 1
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

/wsl-sdk-dotnet
/nuget

# User-specific files
*.rsuser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041.0;net5.0-windows10.0.19041.0</TargetFrameworks>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection</RootNamespace>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041.0;net5.0-windows10.0.19041.0</TargetFrameworks>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Community.Sextant.WinUI.Splat</RootNamespace>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
Expand Down
1 change: 1 addition & 0 deletions Community.Sextant.WinUI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SextantSample.WinUI.FrameWi
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8AF8FE8C-8661-4880-82C6-604CE5756D57}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.github\workflows\auto-approve.yml = .github\workflows\auto-approve.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
README.md = README.md
Expand Down
9 changes: 6 additions & 3 deletions Community.Sextant.WinUI/Community.Sextant.WinUI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041.0;net5.0-windows10.0.19041.0</TargetFrameworks>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Community.Sextant.WinUI</RootNamespace>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
Expand All @@ -28,6 +28,9 @@
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions SextantSample.Core/SextantSample.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Views\RootView.xaml" />
<None Remove="Views\RootView.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="ReactiveUI.WinUI" Version="17.1.17" />
<PackageReference Include="Sextant" Version="2.12.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Community.Sextant.WinUI\Community.Sextant.WinUI.csproj" />
<ProjectReference Include="..\Community.Sextant.WinUI\Community.Sextant.WinUI.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Views\CounterView.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
<Page Update="Views\RootView.xaml">
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
<PackageReference Include="ReactiveUI.WinUI" Version="17.1.17" />
<PackageReference Include="Splat.Microsoft.Extensions.DependencyInjection" Version="14.1.17" />
<Manifest Include="$(ApplicationManifest)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
<PackageReference Include="ReactiveUI.WinUI" Version="17.1.17" />
<PackageReference Include="Sextant" Version="2.12.4" />
<PackageReference Include="Splat" Version="14.1.17" />
Expand Down

0 comments on commit d57c527

Please sign in to comment.