Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
peters committed Nov 9, 2021
2 parents 0245aa9 + e7199fb commit dc5925e
Show file tree
Hide file tree
Showing 138 changed files with 11,692 additions and 11,738 deletions.
76 changes: 45 additions & 31 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ name: snapx
on:
push:
branches:
- develop
- master
- '**'
pull_request:
branches:
- develop

env:
GITVERSION_VERSION: 5.6.6
GITVERSION_VERSION: 5.7.0
MSVS_TOOLSET_VERSION: 16
DOTNET_FRAMEWORK_VERSION: net5.0
DOTNET_SDK_VERSION: 5.0.200
SNAPX_DOTNET_FRAMEWORK_VERSION: net6.0
DOTNET_NET60_VERSION: 6.0.100
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
Expand All @@ -29,9 +28,13 @@ jobs:
SNAPX_VERSION: ${{ steps.set-version.outputs.SNAPX_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0

- 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
Expand All @@ -54,7 +57,7 @@ jobs:
SNAPX_VERSION: ${{ needs.setup.outputs.SNAPX_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
with:
lfs: true
submodules: true
Expand All @@ -66,23 +69,28 @@ jobs:
username: ${{ github.actor }}
password: ${{secrets.GITHUB_TOKEN }}

- name: Setup .NET 6.0
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_NET60_VERSION }}

- name: Build native
shell: pwsh
run: ./build.ps1 Bootstrap-Unix -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
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
run: ./build.ps1 Run-Native-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.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
if: matrix.rid != 'linux-arm64'
shell: pwsh
run: ./build.ps1 Run-Dotnet-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
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
env:
SNAPX_UNIX_SETUP_ZIP_REL_DIR: build/dotnet/${{ matrix.rid }}/Snap.Installer/${{ env.DOTNET_FRAMEWORK_VERSION }}/${{ matrix.configuration }}/publish
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
SNAPX_UNIX_CORERUN_TESTS_REL_DIR: build/native/Unix/${{ matrix.rid }}/${{ matrix.configuration }}/Snap.CoreRun.Tests
SNAPX_UNIX_PAL_REL_DIR: build/native/Unix/${{ matrix.rid }}/${{ matrix.configuration }}/Snap.CoreRun.Pal
Expand Down Expand Up @@ -122,30 +130,30 @@ jobs:
SNAPX_VERSION: ${{ needs.setup.outputs.SNAPX_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
with:
lfs: true
submodules: true
- name: Setup dotnet ${{ env.DOTNET_SDK_VERSION }}
uses: actions/setup-dotnet@v1.7.2

- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: '${{ env.DOTNET_SDK_VERSION }}'
dotnet-version: ${{ env.DOTNET_NET60_VERSION }}

- name: Build native
run: ./build.ps1 Bootstrap-Windows -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
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.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.DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
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
env:
SNAPX_WINDOWS_SETUP_ZIP_REL_DIR: build/dotnet/${{ matrix.rid }}/Snap.Installer/${{ env.DOTNET_FRAMEWORK_VERSION }}/${{ matrix.configuration }}/publish
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 }}
SNAPX_WINDOWS_PAL_REL_DIR: build/native/Windows/${{ matrix.rid }}/${{ matrix.configuration }}/Snap.CoreRun.Pal/${{ matrix.configuration }}
run: |
Expand Down Expand Up @@ -181,7 +189,7 @@ jobs:
# SNAPX_VERSION: ${{ needs.setup.outputs.SNAPX_VERSION }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2.3.4
# uses: actions/checkout@v2.4.0
# with:
# fetch-depth: 0
#
Expand All @@ -191,10 +199,12 @@ jobs:
# name: ubuntu-latest-${{ matrix.rid }}-${{ matrix.configuration }}
# path: ${{ github.workspace }}
#
# - name: Setup dotnet ${{ env.DOTNET_SDK_VERSION }}
# uses: actions/[email protected]

# - name: Setup .NET 6.0
# uses: actions/[email protected]
# with:
# dotnet-version: '${{ env.DOTNET_SDK_VERSION }}'
# dotnet-version: ${{ env.DOTNET_NET60_VERSION }}

#
# - name: Test native
# run: |
Expand All @@ -203,7 +213,7 @@ jobs:
#
# - name: Test .NET
# shell: pwsh
# run: ./build.ps1 Run-Dotnet-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}
# run: ./build.ps1 Run-Dotnet-UnitTests -Version ${{ env.SNAPX_VERSION }} -Configuration ${{ matrix.configuration }} -CIBuild -NetCoreAppVersion ${{ env.SNAPX_DOTNET_FRAMEWORK_VERSION }} -Rid ${{ matrix.rid }}

publish:
if: success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
Expand All @@ -214,7 +224,7 @@ jobs:
SNAPX_VERSION: ${{ needs.setup.outputs.SNAPX_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
with:
lfs: true

Expand Down Expand Up @@ -242,11 +252,15 @@ jobs:
name: windows-latest-win-x64-Release
path: ${{ github.workspace }}

- name: Setup dotnet ${{ env.DOTNET_SDK_VERSION }}
uses: actions/setup-dotnet@v1.7.2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: '${{ env.DOTNET_SDK_VERSION }}'

dotnet-version: ${{ env.DOTNET_NET60_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
Expand All @@ -266,7 +280,7 @@ jobs:
- name: Create github release tag
if: github.ref == 'refs/heads/master'
uses: actions/create-release@v1
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 3.0.11
next-version: 4.0.1
mode: ContinuousDeployment
continuous-delivery-fallback-tag: ''
branches:
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ Checkout our sample application, [snapx demoapp](https://github.com/fintermobili
- Docker >= 19.03.8

**Windows**:
- Docker Desktop >= v2.3.0.3
- Docker Desktop >= v4.0.1
- GitVersion `dotnet tool update gitversion.tool -g`
- Powershell v7 `dotnet tool update powershell -g`
- .NET SDK v5.0
- .NET SDK v6.0

- Visual Studio 2019 16.8 Community with C++ workload installed
- Visual Studio 2022 Preview 4.1 Community with C++ workload installed

#### Bootstrap snapx

Expand All @@ -47,7 +47,7 @@ Run `init.ps1` and all dependencies will be built in `Debug` and `Release` mode.

## .NET frameworks supported

- .NET >= 5.0
- .NET 6.0 LTS

## Platforms supported

Expand All @@ -61,12 +61,10 @@ Run `init.ps1` and all dependencies will be built in `Debug` and `Release` mode.
- Windows Server 2019 R2

- Ubuntu Desktop x64
- 16.04
- 18.04
- 20.04

- Ubuntu Server x64
- 16.04
- 18.04
- 20.04

Expand Down
3 changes: 1 addition & 2 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ function Invoke-Build-Snap-Installer {
Get-Item $SnapInstallerDotnetBuildPublishDir | Remove-Item -Recurse -Force
}

# R2R is only available on Windows.
$PublishReadyToRun = ($Rid.StartsWith("win-")) -and ($Configuration -eq "Debug" ? "False" : "True")
$PublishReadyToRun = "False"

$RuntimeIdentifier = $Rid

Expand Down
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ param(
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
[string] $DockerImageName = "snapx",
[Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
[string] $DockerVersion = "6.5",
[string] $DockerVersion = "10.0",
[Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
[switch] $DockerLocal,
[Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
[switch] $DockerContext,
[Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)]
[switch] $CIBuild,
[Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)]
[string] $NetCoreAppVersion = "net5.0",
[string] $NetCoreAppVersion = "net6.0",
[Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)]
[string] $Version = "0.0.0",
[Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)]
Expand Down
4 changes: 2 additions & 2 deletions cmake/aarch64-linux-gnu.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc-8")
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++-8")
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Expand Down
24 changes: 14 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ RUN \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
uuid-dev:arm64
apt-get install -y --no-install-recommends \
uuid-dev:arm64

RUN \
dpkg --force-architecture --remove-architecture arm64 && \
Expand All @@ -28,29 +28,33 @@ RUN \
rm -rf /var/lib/apt/lists/* && \
apt-get update && \
apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu:amd64 g++-8-aarch64-linux-gnu:amd64 && \
gcc-aarch64-linux-gnu:amd64 g++-aarch64-linux-gnu:amd64 && \
rm -rf /var/lib/apt/lists/*

# x64
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
cmake:amd64 make:amd64 gcc-8:amd64 g++-8:amd64 uuid-dev:amd64 lsb-core:amd64 curl:amd64 wget:amd64 && \
cmake:amd64 make:amd64 gcc:amd64 g++:amd64 uuid-dev:amd64 lsb-core:amd64 curl:amd64 wget:amd64 && \
rm -rf /var/lib/apt/lists/*

RUN \
apt-get update && \
apt-get install -y apt-transport-https:amd64 ca-certificates:amd64 && \
wget --no-check-certificate https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y dotnet-sdk-5.0:amd64 && \
dotnet tool update powershell -g
apt-get update

RUN \
wget https://download.visualstudio.microsoft.com/download/pr/5fcb98bb-21e1-47a5-bb8e-bb25f41a3e52/04811d5d05b7e694f040d2a13c1aae4c/dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz && \
mkdir -p /root/dotnet && tar zxf dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz -C /root/dotnet && \
rm dotnet-sdk-6.0.100-rc.1.21463.6-linux-x64.tar.gz

RUN \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
RUN \
/root/dotnet/dotnet tool update powershell -g

FROM env-build as env-run
ENV PATH="/root/.dotnet/tools:${PATH}"
ENV DOTNET_ROOT="/root/dotnet"
ENV PATH="/root/dotnet:/root/.dotnet/tools:${PATH}"
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
CMD ["sh", "-c", "(cd $SNAPX_DOCKER_WORKING_DIR && pwsh ./build.ps1 $BUILD_PS_PARAMETERS)"]
1 change: 0 additions & 1 deletion nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="avalonia" value="https://www.myget.org/F/avalonia-ci/api/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
Expand Down
2 changes: 1 addition & 1 deletion snapx-dev.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dotnet build -c Debug src/Snapx/Snapx.csproj
dotnet src/Snapx/bin/Debug/net5.0/Snapx.dll %*
dotnet src/Snapx/bin/Debug/net6.0/Snapx.dll %*
2 changes: 1 addition & 1 deletion snapx-dev.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
dotnet build -c Debug src/Snapx/Snapx.csproj
dotnet src/Snapx/bin/Debug/net5.0/snapx.dll $*
dotnet src/Snapx/bin/Debug/net6.0/snapx.dll $*
7 changes: 4 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project>

<PropertyGroup>
<LangVersion>9.0</LangVersion>
<LangVersion>10.0</LangVersion>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
</PropertyGroup>

<PropertyGroup>
<Authors>Finter Mobility As</Authors>
<Authors>Finter As</Authors>
<Product>Snapx</Product>
<Copyright>Copyright © Finter Mobility As</Copyright>
<Copyright>Copyright © Finter As</Copyright>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/fintermobilityas/snapx</PackageProjectUrl>
Expand Down
8 changes: 4 additions & 4 deletions src/Snap.Installer.Tests/Snap.Installer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,10 +22,10 @@

<ItemGroup>
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="System.CodeDom" Version="5.0.0" />
<PackageReference Include="System.Security.Permissions" Version="5.0.0" />
<PackageReference Include="System.CodeDom" Version="6.0.0" />
<PackageReference Include="System.Security.Permissions" Version="6.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit dc5925e

Please sign in to comment.