-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (54 loc) · 2.41 KB
/
Copy pathefcore-cd.yml
File metadata and controls
58 lines (54 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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 EFCore CD
on:
push:
branches: [ "master" ]
env:
PATH_PROJECT: src\RepositoryPattern.EntityFrameworkCore
PATH_RELEASE: src\RepositoryPattern.EntityFrameworkCore\bin\Release
PROJECT_NAME: RepositoryPattern.EntityFrameworkCore.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 }}