From d704d398cd55c44fbc985d2c1d9d4ceb599e4919 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 14 Apr 2023 11:42:04 +0100 Subject: [PATCH] CI - publish builds on master only other branches can be published manually --- .github/workflows/docfx.yml | 6 +++--- .github/workflows/master.yml | 8 +++++--- .github/workflows/nuget.yml | 6 ++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docfx.yml b/.github/workflows/docfx.yml index 50416a113..044774480 100644 --- a/.github/workflows/docfx.yml +++ b/.github/workflows/docfx.yml @@ -1,6 +1,6 @@ name: Master - DocFX -on: +on: workflow_dispatch: push: branches: @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v2 with: - dotnet-version: '6.0.x' + dotnet-version: "7.0.x" - name: Setup DocFX run: choco install docfx -y - name: Build Core @@ -32,4 +32,4 @@ jobs: username: ${{ secrets.FTP_USER }} password: ${{ secrets.FTP_PASSWORD }} local-dir: docfx/docfx_project/_site/ - server-dir: /httpdocs/docs/ \ No newline at end of file + server-dir: /httpdocs/docs/ diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 36d37e0d3..96762a278 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -1,8 +1,10 @@ name: Master - Build -on: +on: workflow_dispatch: push: + branches: + - master jobs: version: @@ -26,11 +28,11 @@ jobs: # If we're not in master, add the branch name to the version so it counts as prerelease if ($BranchName -ne "master") { $VersionNumber += "-$BranchName" } "version-number=$VersionNumber" >> $Env:GITHUB_OUTPUT - + build: needs: version strategy: - matrix: + matrix: include: - os: windows-latest rid: win10-x64 diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index c45941a79..05daa25f3 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -1,8 +1,10 @@ name: Publish Nuget packages -on: +on: workflow_dispatch: push: + branches: + - master jobs: version: @@ -43,4 +45,4 @@ jobs: - name: Pack Artemis.UI.Shared run: dotnet pack -c Release -p:Version=${{ needs.version.outputs.version-number }} src/Artemis.UI.Shared/Artemis.UI.Shared.csproj - name: Push Nugets - run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate \ No newline at end of file + run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate