Skip to content

Commit

Permalink
Revert "switch to .NET 8" (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuylar committed Jan 28, 2024
1 parent e2bbdfb commit 420b754
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,33 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
name: Check out code

- name: Set version
run: echo LIGHTTUBE_VERSION=`date +%Y%m%d` >> $GITHUB_ENV

- name: Check version
run: echo Building version ${{ env.LIGHTTUBE_VERSION }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64
driver-opts: |
image=moby/buildkit:v0.10.6
-
name: Login to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/arm64,linux/amd64
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/r2r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- linux-arm
- linux-arm64
- osx-x64
- osx.11.0-arm64

if: |
!contains(github.event.head_commit.message, 'skip ci')
Expand All @@ -31,11 +32,11 @@ jobs:
contents: write # In order to be able to push releases

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -46,7 +47,7 @@ jobs:
run: dotnet publish -c Release -r ${{ matrix.platform }} -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true -p:PublishTrimmed=true -p:TrimMode=partial --self-contained true

- name: Upload binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }} R2R Binaries
path: '*/bin/Release/*/${{ matrix.platform }}/publish/'
Expand All @@ -63,7 +64,7 @@ jobs:
- name: Create Release
# You may pin to the exact commit or the version.
# uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e
uses: ncipollo/release-action@v1.13.0
uses: ncipollo/release-action@v1.12.0
if: |
github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
Expand Down
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG TARGETARCH
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["LightTube/LightTube.csproj", "LightTube/"]
RUN dotnet restore -a $TARGETARCH "LightTube/LightTube.csproj"
RUN dotnet restore "LightTube/LightTube.csproj"
COPY . .
WORKDIR "/src/LightTube"
RUN dotnet build "LightTube.csproj" -a $TARGETARCH -c Release -o /app/build /p:Version=`date +0.%Y.%m.%d`
RUN dotnet build "LightTube.csproj" -c Release -o /app/build /p:Version=`date +0.%Y.%m.%d`

FROM build AS publish
RUN dotnet publish "LightTube.csproj" -a $TARGETARCH -c Release -o /app/publish /p:Version=`date +0.%Y.%m.%d`
RUN dotnet publish "LightTube.csproj" -c Release -o /app/publish /p:Version=`date +0.%Y.%m.%d`

FROM base AS final
WORKDIR /app
Expand Down
10 changes: 5 additions & 5 deletions LightTube/LightTube.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand All @@ -10,13 +10,13 @@
<PublishReadyToRunExclude Include="ZstdSharp.dll" />
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="InnerTube" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.1" />
<PackageReference Include="InnerTube" Version="1.0.27" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.8" />
<PackageReference Include="MongoDB.Driver" Version="2.23.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
<PackageReference Include="System.Runtime.Caching" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 3 additions & 6 deletions LightTube/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"Serilog": {
"MinimumLevel": {
"Logging": {
"LogLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
Expand Down

0 comments on commit 420b754

Please sign in to comment.