Skip to content

Commit

Permalink
Upgrade .net (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
g3rv4 authored Dec 15, 2023
1 parent fe7703b commit 5919c3b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
shell: pwsh
run: |
$srcPath = Join-Path (Pwd) src
docker run -v "$($srcPath):/var/src" mcr.microsoft.com/dotnet/sdk:6.0.405-alpine3.16 ash -c "dotnet publish -r ${{ matrix.runtime }} --self-contained -p:PublishTrimmed=true -p:PublishSingleFile=true -c Release /var/src/GetMoarFediverse.csproj -o /var/output"
docker run -v "$($srcPath):/var/src" mcr.microsoft.com/dotnet/sdk:8.0.100-1-alpine3.18 ash -c "dotnet publish -r ${{ matrix.runtime }} --self-contained -p:PublishTrimmed=true -p:PublishSingleFile=true -c Release /var/src/GetMoarFediverse.csproj -o /var/output"
build-docker:
runs-on: ubuntu-latest
Expand All @@ -35,5 +35,6 @@ jobs:
if ('${{ matrix.architecture }}' -eq 'arm64v8') {
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
sed -i 's/8.0.100-1-alpine3.18/8.0.100-alpine3.18/' Dockerfile
}
docker build . --build-arg ARCH=${{ matrix.architecture }}
3 changes: 2 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
$uid = sh -c 'id -u'
$gid = sh -c 'id -g'
docker run -v "$($outputPath):/var/output" -v "$($srcPath):/var/src" mcr.microsoft.com/dotnet/sdk:6.0.405-alpine3.16 ash -c "dotnet publish -r ${{ matrix.runtime }} --self-contained -p:PublishTrimmed=true -p:PublishSingleFile=true -c Release /var/src/GetMoarFediverse.csproj -o /var/output && chown -R $($uid):$($gid) /var/output"
docker run -v "$($outputPath):/var/output" -v "$($srcPath):/var/src" mcr.microsoft.com/dotnet/sdk:8.0.100-1-alpine3.18 ash -c "dotnet publish -r ${{ matrix.runtime }} --self-contained -p:PublishTrimmed=true -p:PublishSingleFile=true -c Release /var/src/GetMoarFediverse.csproj -o /var/output && chown -R $($uid):$($gid) /var/output"
Push-Location $outputPath
chmod +r *
Expand Down Expand Up @@ -98,6 +98,7 @@ jobs:
if ('${{ matrix.architecture }}' -eq 'arm64v8') {
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
sed -i 's/8.0.100-1-alpine3.18/8.0.100-alpine3.18/' Dockerfile
}
docker build . -t ghcr.io/g3rv4/getmoarfediverse:latest-${{ matrix.architecture }} --build-arg ARCH=${{ matrix.architecture }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# syntax=docker/dockerfile:1

ARG ARCH=
FROM mcr.microsoft.com/dotnet/sdk:6.0.405-alpine3.16-${ARCH} AS builder
FROM mcr.microsoft.com/dotnet/sdk:8.0.100-1-alpine3.18-${ARCH} AS builder
WORKDIR /src
COPY src /src/
RUN dotnet publish -c Release /src/GetMoarFediverse.csproj -o /app

FROM mcr.microsoft.com/dotnet/aspnet:6.0.13-alpine3.16-${ARCH}
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0-alpine3.18-${ARCH}
VOLUME ["/data"]
ENV CONFIG_PATH=/data/config.json
COPY --from=builder /app /app
Expand Down
2 changes: 1 addition & 1 deletion src/GetMoarFediverse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down

0 comments on commit 5919c3b

Please sign in to comment.