name: Release on: push: branches: [ master ] tags: [ v*.*.* ] jobs: build-artifacts: strategy: matrix: project: - VMelnalksnis.NordigenDotNet - VMelnalksnis.NordigenDotNet.DependencyInjection runs-on: ubuntu-latest env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true steps: - uses: actions/checkout@v2 - name: Setup .NET uses: actions/setup-dotnet@v2.1.0 with: dotnet-version: 6.0.x - run: chmod +x deployment/publish.sh - name: Publish project id: publish run: > deployment/publish.sh "${{ matrix.project }}" "${{ github.run_number }}" - name: Upload artifact uses: actions/upload-artifact@v3 with: name: ${{ steps.publish.outputs.artifact-name }} path: ${{ steps.publish.outputs.artifact }} create-release: name: Create release needs: build-artifacts runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v3 id: download with: path: artifacts - name: Create release uses: softprops/action-gh-release@v0.1.14 with: draft: true prerelease: false tag_name: ${{ github.ref_name }} generate_release_notes: true fail_on_unmatched_files: true files: | ${{ steps.download.outputs.download-path }}/**/*.nupkg - name: NuGet Push run: dotnet nuget push "**/*.nupkg" --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json working-directory: ${{ steps.download.outputs.download-path }}