diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index d15fccc3..00000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: PushToNuget -env: - NUGET_DIR: '${{ github.workspace }}/nuget' - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Pack Blazor.Diagrams.Core - working-directory: src/Blazor.Diagrams.Core - run: 'dotnet pack -p:GeneratePackageOnBuild=false --configuration Release --output ${{ env.NUGET_DIR }}' - - - name: Pack Blazor.Diagrams - working-directory: src/Blazor.Diagrams - run: 'dotnet pack -p:GeneratePackageOnBuild=false --configuration Release --output ${{ env.NUGET_DIR }}' - - - name: Pack Blazor.Diagrams.Algorithms - working-directory: src/Blazor.Diagrams.Algorithms - run: 'dotnet pack -p:GeneratePackageOnBuild=false --configuration Release --output ${{ env.NUGET_DIR }}' - - - name: Push Blazor.Diagrams.Core - run: 'dotnet nuget push ${{ env.NUGET_DIR }}/Z.Blazor.Diagrams.Core.3.0.1.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate' - - - name: Push Blazor.Diagrams - run: 'dotnet nuget push ${{ env.NUGET_DIR }}/Z.Blazor.Diagrams.3.0.1.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate' - - - name: Push Blazor.Diagrams.Algorithms - run: 'dotnet nuget push ${{ env.NUGET_DIR }}/Z.Blazor.Diagrams.Algorithms.3.0.1.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ada0329a..f64da086 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ name: Create release +# On push to master branch. i.e. when we merge a PR. on: push: branches: [ master ] @@ -24,6 +25,7 @@ jobs: 6.0.x 3.1.x + # Finds the latest release and increases the version - name: Get next version uses: reecetech/version-increment@2023.9.3 id: version @@ -34,15 +36,18 @@ jobs: - name: Install version tool run: dotnet tool install -g dotnetCampus.TagToVersion + # Writes the new version number to build/Version.props - name: Set version run: dotnet TagToVersion -t ${{ steps.version.outputs.version }} - name: Install dependencies run: dotnet restore + # Pacakge is created on build - name: Build run: dotnet build --configuration Release + # Upload package as an atrifact to the GitHub action - name: Upload packages uses: actions/upload-artifact@v3 with: @@ -50,6 +55,7 @@ jobs: path: /home/runner/work/Blazor.Diagrams/Blazor.Diagrams/src/Blazor.Diagrams/bin/Release/*.nupkg retention-days: 5 + # Create a new release and upload the package to the release - name: Release uses: softprops/action-gh-release@v1 with: