Skip to content

Commit

Permalink
Add support for .NET 7.0 preview 2 (#221)
Browse files Browse the repository at this point in the history
* Add .NET 7.0 version.

* Removed submodule src/Vendor/crossguid

* Add support for .NET 7.0 preview 2.

* Update docker image version.
  • Loading branch information
peters authored Mar 30, 2022
1 parent d20a85d commit 3d8c6fa
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 139 deletions.
82 changes: 45 additions & 37 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: snapx

on:
push:
on:
push:
branches:
- '**'
pull_request:
- "**"
pull_request:
branches:
- develop

Expand All @@ -13,15 +13,15 @@ env:
MSVS_TOOLSET_VERSION: 16
SNAPX_DOTNET_FRAMEWORK_VERSION: net6.0
DOTNET_NET60_VERSION: 6.0.201
DOTNET_NET70_VERSION: 7.0.100-preview.2.22153.17
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
SNAPX_CI_BUILD: 1
SNAPX_CORERUN_ALLOW_ELEVATED_CONTEXT: 1

jobs:

setup:
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
Expand All @@ -35,15 +35,15 @@ jobs:
- name: Add dotnet tools to environment path
shell: pwsh
run: echo "${HOME}/.dotnet/tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- id: set-version
name: Setup GitVersion and set build version
shell: pwsh
run: |
dotnet tool update GitVersion.Tool --global --version ${{ env.GITVERSION_VERSION }}
$SNAPX_VERSION = (dotnet gitversion /showVariable NugetVersionv2) | out-string
echo "::set-output name=SNAPX_VERSION::$SNAPX_VERSION"
linux:
runs-on: ${{ matrix.os }}
name: Bootstrap ${{ matrix.rid }}-${{ matrix.configuration }}
Expand All @@ -66,18 +66,20 @@ jobs:
name: Docker login github packages
with:
login-server: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
password: ${{secrets.GITHUB_TOKEN }}

- name: Setup .NET 6.0
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_NET60_VERSION }}
dotnet-version: |
${{ env.DOTNET_NET60_VERSION }}
${{ env.DOTNET_NET70_VERSION }}
- name: Build native
shell: pwsh
run: ./build.ps1 Bootstrap-Unix -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}

- name: Test native
if: matrix.rid != 'linux-arm64'
shell: pwsh
Expand All @@ -88,7 +90,7 @@ jobs:
shell: pwsh
run: ./build.ps1 Run-Dotnet-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}

- name: Collect artifacts
- name: Collect artifacts
env:
SNAPX_UNIX_SETUP_ZIP_REL_DIR: build/dotnet/${{ matrix.rid }}/Snap.Installer/${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }}/${{ matrix.configuration }}/publish
SNAPX_UNIX_CORERUN_REL_DIR: build/native/Unix/${{ matrix.rid }}/${{ matrix.configuration }}/Snap.CoreRun
Expand Down Expand Up @@ -128,30 +130,32 @@ jobs:
os: [windows-latest]
env:
SNAPX_VERSION: ${{ needs.setup.outputs.SNAPX_VERSION }}
steps:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
submodules: true

- name: Setup .NET 6.0
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_NET60_VERSION }}
dotnet-version: |
${{ env.DOTNET_NET60_VERSION }}
${{ env.DOTNET_NET70_VERSION }}
- name: Build native
run: ./build.ps1 Bootstrap-Windows -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}

- name: Test native
shell: pwsh
run: ./build.ps1 Run-Native-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
run: ./build.ps1 Run-Native-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}

- name: Test .NET
shell: pwsh
run: ./build.ps1 Run-Dotnet-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
- name: Collect artifacts

- name: Collect artifacts
env:
SNAPX_WINDOWS_SETUP_ZIP_REL_DIR: build/dotnet/${{ matrix.rid }}/Snap.Installer/${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }}/${{ matrix.configuration }}/publish
SNAPX_WINDOWS_CORERUN_REL_DIR: build/native/Windows/${{ matrix.rid }}/${{ matrix.configuration }}/Snap.CoreRun/${{ matrix.configuration }}
Expand Down Expand Up @@ -179,7 +183,7 @@ jobs:
# needs: [setup, linux]
# strategy:
# matrix:
# include:
# include:
# - rid: linux-arm64
# configuration: Debug
# - rid: linux-arm64
Expand All @@ -198,14 +202,16 @@ jobs:
# with:
# name: ubuntu-latest-${{ matrix.rid }}-${{ matrix.configuration }}
# path: ${{ github.workspace }}
#
#

# - name: Setup .NET 6.0
# - name: Setup .NET
# uses: actions/setup-dotnet@v2
# with:
# dotnet-version: ${{ env.DOTNET_NET60_VERSION }}
# dotnet-version: |
# ${{ env.DOTNET_NET60_VERSION }}
# ${{ env.DOTNET_NET70_VERSION }}

#
#
# - name: Test native
# run: |
# chmod +x ${{ env.SNAPX_UNIX_CORERUN_TESTS_REL_DIR }}/corerun_tests
Expand All @@ -225,7 +231,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
with:
lfs: true

- name: Download ubuntu-latest-linux-arm64-Release artifacts
Expand All @@ -239,7 +245,7 @@ jobs:
with:
name: ubuntu-latest-linux-x64-Release
path: ${{ github.workspace }}

- name: Download windows-latest-win-x86-Release artifacts
uses: actions/download-artifact@v2
with:
Expand All @@ -251,25 +257,27 @@ jobs:
with:
name: windows-latest-win-x64-Release
path: ${{ github.workspace }}
- name: Setup .NET 6.0

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_NET60_VERSION }}

dotnet-version: |
${{ env.DOTNET_NET60_VERSION }}
${{ env.DOTNET_NET70_VERSION }}
- name: Add dotnet tools to environment path
shell: pwsh
run: echo "${HOME}/.dotnet/tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Build nupkgs
shell: pwsh
run: ./build.ps1 -Target Snapx -CIBuild -Version ${{ env.SNAPX_VERSION }} -Configuration Release

- name: Push nuget packages
shell: pwsh
run: |
$nupkgs = Get-ChildItem ".\${{ env.GITHUB_WORKSPACE }}\nupkgs" -Filter *.nupkg | Select-Object -ExpandProperty FullName
$nupkgs | ForEach-Object {
dotnet nuget push $_ --source nuget.org --api-key ${{ secrets.PETERSUNDE_NUGET_ORG_API_KEY }}
if($LASTEXITCODE -ne 0)
Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "src/Vendor/gtest"]
path = src/Vendor/gtest
url = https://github.com/google/googletest.git
[submodule "src/Vendor/crossguid"]
path = src/Vendor/crossguid
url = https://github.com/graeme-hill/crossguid.git
[submodule "src/Vendor/plog"]
path = src/Vendor/plog
url = https://github.com/SergiusTheBest/plog.git
[submodule "src/Vendor/cxxopts"]
path = src/Vendor/cxxopts
url=https://github.com/jarro2783/cxxopts.git
url=https://github.com/jarro2783/cxxopts.git
[submodule "src/Vendor/nanoid_cpp"]
path = src/Vendor/nanoid_cpp
url = https://github.com/mcmikecreations/nanoid_cpp.git
83 changes: 50 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 📖 About Snapx
# 📖 About Snapx

[![Gitter](https://badges.gitter.im/fintermobilityas-snapx/community.svg)](https://gitter.im/fintermobilityas-snapx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) ![License](https://img.shields.io/github/license/fintermobilityas/snapx.svg)
<br>
[![NuGet](https://img.shields.io/nuget/v/snapx.svg)](https://www.nuget.org/packages/snapx) [![downloads](https://img.shields.io/nuget/dt/snapx)](https://www.nuget.org/packages/snapx) ![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/snapx) ![Size](https://img.shields.io/github/repo-size/fintermobilityas/snapx.svg)
[![NuGet](https://img.shields.io/nuget/v/snapx.svg)](https://www.nuget.org/packages/snapx) [![downloads](https://img.shields.io/nuget/dt/snapx)](https://www.nuget.org/packages/snapx) ![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/snapx) ![Size](https://img.shields.io/github/repo-size/fintermobilityas/snapx.svg)

| Build server | Platforms | Build status |
|--------------|----------|--------------|
| Build server | Platforms | Build status |
| -------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Github Actions | linux-x64, linux-arm64, win-x86, win-x64 | Branch: develop ![snapx](https://github.com/fintermobilityas/snapx/workflows/snapx/badge.svg?branch=develop) |
| Github Actions | linux-x64, linux-arm64, win-x86, win-x64 | Branch: master ![snapx](https://github.com/fintermobilityas/snapx/workflows/snapx/badge.svg?branch=master) |
| Github Actions | linux-x64, linux-arm64, win-x86, win-x64 | Branch: master ![snapx](https://github.com/fintermobilityas/snapx/workflows/snapx/badge.svg?branch=master) |

**snapx** is a powerful xplat .NET application with built-in support for delta updates, release channels (test, staging, production) and automatic deployment using GitHub Actions. Updates can delivered via NuGet or network share (UNC).

Expand All @@ -22,6 +22,7 @@ Checkout our sample application, [snapx demoapp](https://github.com/fintermobili
<img src="https://media.githubusercontent.com/media/fintermobilityas/snapx/develop/docs/snapxinstaller.gif" width="794" />

#### Available commands

![snapx usage](https://github.com/fintermobilityas/snapx/blob/develop/docs/shell.png)

### Local development requirements
Expand All @@ -31,62 +32,78 @@ Checkout our sample application, [snapx demoapp](https://github.com/fintermobili
**Linux**

- Docker >= 19.03.8
- GitVersion `dotnet tool update gitversion.tool -g`
- Powershell v7 `dotnet tool update powershell -g`
- .NET SDK v6.0
- .NET SDK v7.0

**Windows**:

- Docker Desktop >= v4.0.1
- GitVersion `dotnet tool update gitversion.tool -g`
- Powershell v7 `dotnet tool update powershell -g`
- .NET SDK v6.0
- .NET SDK v7.0

- Visual Studio 2022 Community Edition with C++ workload installed

#### Bootstrap snapx
#### Bootstrap snapx

Before you can open `src\Snapx.sln` in Visual Studio you must bootstrap dependencies.
Run `init.ps1` and all dependencies will be built in `Debug` and `Release` mode.

## .NET frameworks supported

- .NET 6.0 LTS
- .NET 7.0

## Platforms supported

- Windows x86/x64
- Windows 7 SP1
- Windows Vista SP 2
- Windows 8.1
- Windows Server 2008 R2
- Windows Server 2012 R2
- Windows Server 2016 R2
- Windows Server 2019 R2

- Ubuntu Desktop x64
- 18.04
- 20.04

- Ubuntu Server x64
- 18.04
- 20.04

- Ubuntu Desktop arm64
- 18.04
- 20.04

- Ubuntu Server arm64
- 18.04
- 20.04

- Raspberry Pi OS arm64
- Windows x86/x64

- Windows 7 SP1
- Windows Vista SP 2
- Windows 8.1
- Windows Server 2008 R2
- Windows Server 2012 R2
- Windows Server 2016 R2
- Windows Server 2019 R2

- Ubuntu Desktop x64

- 18.04
- 20.04
- 22.04

- Ubuntu Server x64

- 18.04
- 20.04
- 22.04

- Ubuntu Desktop arm64

- 18.04
- 20.04
- 22.04

- Ubuntu Server arm64
- 18.04
- 20.04
- 22.04
- Raspberry Pi OS arm64

## Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
For more information see the [Code of Conduct](https://github.com/fintermobilityas/snapx/blob/develop/CODE_OF_CONDUCT.md).
For more information see the [Code of Conduct](https://github.com/fintermobilityas/snapx/blob/develop/CODE_OF_CONDUCT.md).

## Sponsors

<p align="center">
<a href="https://www.finterjobs.com" target="_blank"><img src="https://static.wixstatic.com/media/49c5ac_e5c089f7be224d6e92eb3f2f5edc3535~mv2.png/v1/crop/x_173,y_545,w_938,h_425/fill/w_189,h_87,al_c,q_85,usm_0.66_1.00_0.01/Finter%20Mobility%20AS%20gjennomsiktig%20bakgrun.webp"></a>
</p>

## License

Snapx is under the MIT license. See the [LICENSE](LICENSE.md) for more information.
6 changes: 6 additions & 0 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ function Invoke-Dotnet-UnitTests
OSPlatform = "Any"
Skip = $IsWinX86CIBuild
}
@{
SrcDirectory = Join-Path $SrcDir Snap.Tests
Framework = "net7.0"
OSPlatform = "Any"
Skip = $IsWinX86CIBuild
}
@{
SrcDirectory = Join-Path $SrcDir Snap.Installer.Tests
Framework = $NetCoreAppVersion
Expand Down
Loading

0 comments on commit 3d8c6fa

Please sign in to comment.