From bbec57c3ad7b29864d71d8e2cbfe08d8ff212277 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 30 Jul 2023 19:37:58 +0200 Subject: [PATCH] Update actions --- .dockerignore | 1 + .github/workflows/build.yml | 45 ---------------------------- .github/workflows/server.yml | 31 ------------------- .github/workflows/upload-crowdin.yml | 24 --------------- Dockerfile | 14 ++++++--- docker-build.sh | 3 ++ 6 files changed, 14 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/server.yml delete mode 100644 .github/workflows/upload-crowdin.yml create mode 100755 docker-build.sh diff --git a/.dockerignore b/.dockerignore index 102b835..62da793 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,4 +4,5 @@ .gitignore Dockerfile .dockerignore +docker-build.sh .vs/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a54d18f..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: dotnet build -on: - push: - paths-ignore: - - '**.md' - - 'Dockerfile' -jobs: - build: - runs-on: windows-latest - env: - DOTNET_CLI_TELEMETRY_OPTOUT: 'true' - NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages - - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0 - - - name: Download Dalamud - run: | - Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip - Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" - - - id: cache-dependencies - uses: actions/cache@v3 - with: - path: ${{ github.workspace }}/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - restore-keys: | - ${{ runner.os }}-nuget- - - - name: Install dependencies - run: dotnet restore - - - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Test - run: dotnet test --no-restore --verbosity normal - timeout-minutes: 10 diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml deleted file mode 100644 index 1e5451f..0000000 --- a/.github/workflows/server.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: docker build -on: - push: - branches: - - master - paths: - - '.github/workflows/server.yml' - - 'Pal.Common/**' - - 'Pal.Server/**' - - 'Dockerfile' - workflow_dispatch: { } -permissions: - packages: write -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Login to GitHub Package Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - push: true - tags: ghcr.io/${{ github.repository_owner }}/palace-pal:latest diff --git a/.github/workflows/upload-crowdin.yml b/.github/workflows/upload-crowdin.yml deleted file mode 100644 index b438b66..0000000 --- a/.github/workflows/upload-crowdin.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Upload to Crowdin -on: - push: - branches: - - master - paths: - - 'Pal.Client/Properties/*.resx' - - 'crowdin.yml' - workflow_dispatch: { } -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Crowdin Action - uses: crowdin/github-action@1.4.9 - with: - upload_sources: true - upload_translations: true - download_translations: false - crowdin_branch_name: ${{ github.ref_name }} - env: - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/Dockerfile b/Dockerfile index f7dc162..305b3d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,19 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build-env +ARG TARGETARCH WORKDIR /build COPY Pal.Common/Pal.Common.csproj Pal.Common/ COPY Pal.Server/Pal.Server.csproj Pal.Server/ -RUN dotnet restore Pal.Server/Pal.Server.csproj +RUN dotnet restore Pal.Server/Pal.Server.csproj -a $TARGETARCH COPY . ./ -RUN dotnet publish Pal.Server/Pal.Server.csproj --configuration Release --no-restore -o /dist +RUN dotnet publish Pal.Server/Pal.Server.csproj -a $TARGETARCH --no-restore -o /dist + +FROM mcr.microsoft.com/dotnet/aspnet:8.0-preview + +# fix later +ENV DOTNET_ROLL_FORWARD=Major +ENV DOTNET_ROLL_FORWARD_PRE_RELEASE=1 -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime EXPOSE 5415 ENV DOTNET_ENVIRONMENT=Production ENV ASPNETCORE_URLS= diff --git a/docker-build.sh b/docker-build.sh new file mode 100755 index 0000000..6e466ac --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,3 @@ +git fetch origin master +git reset --hard origin/master +docker buildx build -t git.carvel.li/liza/palacepal/server --platform linux/amd64,linux/arm64 --push .