Merge pull request #37 from carlosjortiz/develop #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: Repository Pattern Abstractions CD | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| env: | |
| PATH_PROJECT: src\RepositoryPattern.Abstractions | |
| PATH_RELEASE: src\RepositoryPattern.Abstractions\bin\Release | |
| PROJECT_NAME: RepositoryPattern.Abstractions.csproj | |
| jobs: | |
| publish: | |
| name: Publish Lib | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setting up .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: | | |
| 8.x | |
| 7.x | |
| 6.x | |
| # cache: true | |
| - name: Restoring dependencies | |
| run: dotnet restore | |
| working-directory: ${{ env.PATH_PROJECT }} | |
| - name: Building the project | |
| run: dotnet build --no-restore --configuration Release | |
| working-directory: ${{ env.PATH_PROJECT }} | |
| - name: Creatnig NuGet Package | |
| run: dotnet pack ${{ env.PROJECT_NAME }} --no-build -c Release | |
| working-directory: ${{ env.PATH_PROJECT }} | |
| - name: Publishing into NuGet | |
| run: dotnet nuget push *.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json | |
| working-directory: ${{ env.PATH_RELEASE }} | |
| - name: Publishing into Github Packages | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: dotnet nuget push *.nupkg --skip-duplicate --api-key ${{ secrets.GH_TOKEN }} --source https://nuget.pkg.github.com/carlosjortiz/index.json | |
| working-directory: ${{ env.PATH_RELEASE }} | |
| # - name: Creating Release in Github | |
| # env: | |
| # GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| # REPO_NAME: ${{ github.event.repository.name }} | |
| # run: | | |
| # $xml = [xml](Get-Content ${{env.PROJECT_NAME}}) | |
| # $version = $xml.Project.PropertyGroup.Version | |
| # $notes = $xml.Project.PropertyGroup.PackageReleaseNotes | |
| # $repo = $env:GITHUB_REPOSITORY | |
| # gh release create "v$version" -t "${{ env.REPO_NAME}}-v${version}" -n "${notes}" -R "$repo" | |
| # Compress-Archive -Path ".\bin\Release\*" -DestinationPath ".\bin\Release\${{ env.REPO_NAME }}-v${version}.zip" | |
| # gh release upload "v${version}" .\bin\Release\${{ env.REPO_NAME }}-v${version}.zip --clobber | |
| # working-directory: ${{ env.PATH_PROJECT }} |