From 25209828bbcc5e32b4608ec4c1123125a5844963 Mon Sep 17 00:00:00 2001 From: Sun Zhongfeng Date: Thu, 30 Nov 2023 18:09:03 +0800 Subject: [PATCH] update ci --- .config/dotnet-tools.json | 12 ------------ .github/workflows/ci.yaml | 11 ++--------- .github/workflows/deploy_check.yaml | 27 --------------------------- .github/workflows/pr.yaml | 2 +- .github/workflows/release.yaml | 9 +-------- src/FabronService/Dockerfile | 4 ++-- 6 files changed, 6 insertions(+), 59 deletions(-) delete mode 100644 .config/dotnet-tools.json delete mode 100644 .github/workflows/deploy_check.yaml diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index a90296d..0000000 --- a/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "dotnet-validate": { - "version": "0.0.1-preview.304", - "commands": [ - "dotnet-validate" - ] - } - } -} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 55ca533..9d80c19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.400" + dotnet-version: "8.0.400" - name: Restore dependencies run: dotnet restore - name: Build @@ -29,17 +29,10 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0" - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "7.0.400" + dotnet-version: "8.0.100" - name: Restore dependencies run: dotnet restore - name: Restore tools run: dotnet tool restore - name: Build run: dotnet build --configuration Release --no-restore --version-suffix="ci.${GITHUB_RUN_NUMBER}" - - name: Validate - run: Get-Item pkgs/*.nupkg |% { dotnet tool run dotnet-validate package local $_ } - shell: pwsh diff --git a/.github/workflows/deploy_check.yaml b/.github/workflows/deploy_check.yaml deleted file mode 100644 index 6631a68..0000000 --- a/.github/workflows/deploy_check.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Deploy Check -on: - pull_request: - branches: [ main ] - paths: [ deploy/** ] -jobs: - preview: - name: Preview Changes - runs-on: ubuntu-latest - environment: sandbox - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v1.0.1 - - name: Pulumi up - run: | - echo "${{secrets.KUBECONFIG}}" > .kubeconfig - yarn install - pulumi stack select sandbox - pulumi preview - working-directory: ./deploy - env: - PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} - KUBECONFIG: .kubeconfig - IMAGE_VERSION: build.${{ github.run_number }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cfb2626..3672cb7 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,7 +10,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0.400' + dotnet-version: '8.0.100' include-prerelease: true - name: Restore dependencies run: dotnet restore diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ecfbab7..e4fc056 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,20 +12,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0" - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "7.0.400" + dotnet-version: "8.0.100" - name: Restore dependencies run: dotnet restore - name: Restore tools run: dotnet tool restore - name: Build run: dotnet build --configuration Release --no-restore /p:version="${GITHUB_REF_NAME//v/}" - - name: Validate - run: Get-Item pkgs/*.nupkg |% { dotnet tool run dotnet-validate package local $_ } - shell: pwsh - name: NuGet Push run: Get-Item pkgs/*.nupkg |% { dotnet nuget push $_ --source ${{ secrets.NUGET_SOURCE }} --api-key ${{ secrets.NUGET_APIKEY }} } shell: pwsh diff --git a/src/FabronService/Dockerfile b/src/FabronService/Dockerfile index 5b26a92..32b0a64 100644 --- a/src/FabronService/Dockerfile +++ b/src/FabronService/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0.100 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build WORKDIR /source # copy csproj and restore as distinct layers @@ -23,7 +23,7 @@ WORKDIR /source/src/FabronService RUN dotnet publish -c release -o /app --no-restore # final stage/image -FROM mcr.microsoft.com/dotnet/aspnet:7.0.1 +FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 WORKDIR /app ENV Logging__Console__FormatterName="ejson" COPY --from=build /app ./