Skip to content

Commit

Permalink
Switch back to portable application and .NET Core 3.1
Browse files Browse the repository at this point in the history
This change breaks the release format. Now the release is a tarball
containing a single directory `turkey` containing `turkey/Turkey.dll`
which is the main dll of the application.

To support multiple .NET releases, platforms, architectures and even
operating system differences more easily, switch to portable builds with
roll-forward enabled. That allows the system .NET (which presuably works
on the combination of OS, architecture, system libraries, etc) to take
care of running the test suite itself.

That requires switching the application back to .NET Core 3.1 as the
TargetFramework. Enabling RollForward means the application should
continue to work fine on newer releases. This chnage enables running
unit tests to help confirm that.
  • Loading branch information
omajid committed Feb 14, 2022
1 parent b5b6b6c commit 57ad187
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ jobs:
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
dotnet_version:
- "3.1"
- "5.0"
- "6.0"
exclude:
- container_image: registry.fedoraproject.org/fedora:rawhide
dotnet_version: "5.0"

container:
image: ${{ matrix.container_image }}
Expand Down Expand Up @@ -54,7 +59,12 @@ jobs:
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
dotnet_version:
- "3.1"
- "5.0"
- "6.0"
exclude:
- container_image: registry.fedoraproject.org/fedora:rawhide
dotnet_version: "5.0"

container:
image: ${{ matrix.container_image }}
Expand Down Expand Up @@ -86,7 +96,9 @@ jobs:
- name: Install Test dependencies
timeout-minutes: 2
run: |
dnf install -y python3 wget $(grep '^Dependencies: ' dotnet-regular-tests/README.md | cut -d: -f2-) --skip-broken
dnf install -y python3 wget \
$(grep '^Dependencies: ' dotnet-regular-tests/README.md | cut -d: -f2-) \
--skip-broken
- name: Run reproducers
run: |
Expand All @@ -99,7 +111,9 @@ jobs:
rm -r dotnet-regular-tests/telemetry-is-off-by-default dotnet-regular-tests/bash-completion
fi
./bin/turkey dotnet-regular-tests -v
dotnet --info
dotnet turkey/Turkey.dll dotnet-regular-tests -v
- name: Show Logs
if: ${{ always() }}
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- name: Install dependencies
run: |
dnf install -y dotnet-sdk-6.0 git make
dnf install -y dotnet-sdk-3.1 git make
- uses: actions/checkout@v2

Expand All @@ -35,7 +35,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: release-binaries
path: bin/turkey
path: turkey.tar.gz

release:
name: Create Release
Expand Down Expand Up @@ -71,16 +71,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: turkey
asset_name: turkey
asset_content_type: application/octet-stream

- name: Upload Release Asset (x86_64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: turkey
asset_name: turkey-x86_64
asset_content_type: application/octet-stream
asset_path: turkey.tar.gz
asset_name: turkey.tar.gz
asset_content_type: application/gzip
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FRAMEWORK:=net6.0
FRAMEWORK:=netcoreapp3.1
CONFIGURATION:=Release
ARCH:=$(subst aarch64,arm64,$(subst x86_64,x64,$(shell uname -m)))
RUNTIME:=linux-$(ARCH)
SINGLE_FILE:=$(if $(filter-out s390x,$(ARCH)),true,false)

all: publish

check:
dotnet test -c Release --verbosity detailed Turkey.Tests
dotnet test -f $(FRAMEWORK) -c Release --verbosity detailed Turkey.Tests

run-samples:
rm -rf ~/.nuget.orig && mv ~/.nuget ~/.nuget.orig && mkdir -p ~/.nuget
Expand All @@ -21,21 +20,19 @@ publish:
cat GIT_TAG_VERSION
(cd Turkey; \
dotnet publish \
-f $(FRAMEWORK) \
-c $(CONFIGURATION) \
-r $(RUNTIME) \
--self-contained true \
-p:VersionPrefix=$$(cat ../GIT_TAG_VERSION) \
-p:VersionSuffix=$$(cat ../GIT_COMMIT_ID) \
-p:PublishSingleFile=$(SINGLE_FILE) \
-p:IncludeAllContentForSelfExtract=$(SINGLE_FILE) \
-p:PublishTrimmed=true)
mkdir -p bin
cp -a ./Turkey/bin/$(CONFIGURATION)/$(FRAMEWORK)/$(RUNTIME)/publish/Turkey bin/turkey
-o $$(readlink -f $$(pwd)/../turkey))
tar czf turkey.tar.gz turkey/

clean:
rm -f GIT_COMMIT_ID GIT_TAG_VERSION
rm -rf Turkey/bin Turkey/obj
rm -rf Turkey.Tests/bin Turkey.Tests/obj
rm -rf bin
rm -rf turkey turkey.tar.gz
find -iname '*.log' -delete

fix-line-endings:
Expand Down
6 changes: 3 additions & 3 deletions Turkey.Tests/Turkey.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<RollForward>Major</RollForward>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Turkey/Turkey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseAppHost>false</UseAppHost>
<RollForward>Major</RollForward>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 57ad187

Please sign in to comment.