From 60361e6dab73b7b6a9578efb79957e98fe2c3fcf Mon Sep 17 00:00:00 2001 From: capdiem Date: Thu, 27 Jun 2024 16:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20add=20push-nuget=20work?= =?UTF-8?q?flows=20and=20update=20build=20workflow=20(#2002)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/{pr-docs-next.yml => build.yml} | 3 +- .github/workflows/mirror-gitlab.yml | 29 ----------------- .../workflows/push-nuget-package-manually.yml | 31 +++++++++++++++++++ .../push-nuget-package-on-release.yml | 27 ++++++++++++++++ 4 files changed, 60 insertions(+), 30 deletions(-) rename .github/workflows/{pr-docs-next.yml => build.yml} (96%) delete mode 100644 .github/workflows/mirror-gitlab.yml create mode 100644 .github/workflows/push-nuget-package-manually.yml create mode 100644 .github/workflows/push-nuget-package-on-release.yml diff --git a/.github/workflows/pr-docs-next.yml b/.github/workflows/build.yml similarity index 96% rename from .github/workflows/pr-docs-next.yml rename to .github/workflows/build.yml index a6919f3130..a598c4da2e 100644 --- a/.github/workflows/pr-docs-next.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: pr-docs-next +name: Build on: pull_request: @@ -6,6 +6,7 @@ on: - main paths: - docs/** + - src/** workflow_dispatch: jobs: diff --git a/.github/workflows/mirror-gitlab.yml b/.github/workflows/mirror-gitlab.yml deleted file mode 100644 index 7316f5923f..0000000000 --- a/.github/workflows/mirror-gitlab.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Mirror to Gitlab -on: - push: - paths: - - src/Masa.Blazor/** - - .gitlab-ci.yml - delete: - paths: - - src/Masa.Blazor/** - - .gitlab-ci.yml - create: - paths: - - src/Masa.Blazor/** - - .gitlab-ci.yml - workflow_dispatch: - -jobs: - to_gitlab: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: config git - run: git config --global http.postBuffer 524288000 - - uses: yesolutions/mirror-action@v0.5.1 - with: - REMOTE: '${{ secrets.GITLAB_ADDER }}/cicd/masa.blazor1.git' - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }} - diff --git a/.github/workflows/push-nuget-package-manually.yml b/.github/workflows/push-nuget-package-manually.yml new file mode 100644 index 0000000000..6fa6df6fb7 --- /dev/null +++ b/.github/workflows/push-nuget-package-manually.yml @@ -0,0 +1,31 @@ +name: Push nuget package manually +on: + workflow_dispatch: + inputs: + version: + description: 'The version of the package, no "v" prefix' + required: true + default: '1.0.0' + +jobs: + push-nuget-manually: + runs-on: ubuntu-latest + steps: + - name: git pull + uses: actions/checkout@v3 + - name: setting dotnet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 8.0.x + 7.0.x + 6.0.x + include-prerelease: true + - name: build + run: dotnet build src/Masa.Blazor.SomethingSkia/Masa.Blazor.SomethingSkia.csproj -c Release /p:ContinuousIntegrationBuild=true + - name: pack Masa.Blazor + run: dotnet pack src/Masa.Blazor/Masa.Blazor.csproj --no-build --include-symbols -c Release -p:PackageVersion=${{github.event.inputs.version}} + - name: pack Masa.Blazor.SomethingSkia + run: dotnet pack src/Masa.Blazor.SomethingSkia/Masa.Blazor.SomethingSkia.csproj --no-build --include-symbols -c Release -p:PackageVersion=${{github.event.inputs.version}} + - name: package push + run: dotnet nuget push "**/*.symbols.nupkg" --skip-duplicate -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/.github/workflows/push-nuget-package-on-release.yml b/.github/workflows/push-nuget-package-on-release.yml new file mode 100644 index 0000000000..f8aa053805 --- /dev/null +++ b/.github/workflows/push-nuget-package-on-release.yml @@ -0,0 +1,27 @@ +name: Push nuget package on release +on: + release: + types: [published] + +jobs: + push-nuget-on-release: + runs-on: ubuntu-latest + steps: + - name: git pull + uses: actions/checkout@v3 + - name: setting dotnet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 8.0.x + 7.0.x + 6.0.x + include-prerelease: true + - name: build + run: dotnet build src/Masa.Blazor.SomethingSkia/Masa.Blazor.SomethingSkia.csproj -c Release /p:ContinuousIntegrationBuild=true + - name: pack Masa.Blazor + run: dotnet pack src/Masa.Blazor/Masa.Blazor.csproj --no-build --include-symbols -c Release -p:PackageVersion=$GITHUB_REF_NAME + - name: pack Masa.Blazor.SomethingSkia + run: dotnet pack src/Masa.Blazor.SomethingSkia/Masa.Blazor.SomethingSkia.csproj --no-build --include-symbols -c Release -p:PackageVersion=$GITHUB_REF_NAME + - name: package push + run: dotnet nuget push "**/*.symbols.nupkg" --skip-duplicate -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json \ No newline at end of file