Browse Source

Improve publish.yml

pull/87/head
gdlcf88 6 years ago
parent
commit
40e39f05d0
  1. 26
      .github/workflows/publish.yml

26
.github/workflows/publish.yml

@ -10,18 +10,12 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: warrenbuckley/Setup-Nuget@v1 - uses: warrenbuckley/Setup-Nuget@v1
- name: dotnet build
run: dotnet build -c Release
- name: dotnet pack
run: dotnet pack -c Release --no-build -o dest
- name: read common.props - name: read common.props
id: commonProps id: commonProps
uses: juliangruber/read-file-action@v1 uses: juliangruber/read-file-action@v1
with: with:
path: ./common.props path: ./common.props
- name: get version - name: get version
id: getVersion id: getVersion
uses: AsasInnab/regex-action@v1 uses: AsasInnab/regex-action@v1
@ -30,11 +24,11 @@ jobs:
regex_flags: 'gim' regex_flags: 'gim'
search_string: '${{ steps.commonProps.outputs.content }}' search_string: '${{ steps.commonProps.outputs.content }}'
- name: add git tag - name: dotnet build
uses: Klemensas/action-autotag@stable run: dotnet build -c Release
with:
version: ${{ steps.commonProps.outputs.content }} - name: dotnet pack
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: dotnet pack -c Release --no-build -o dest
- name: remove unused packages - name: remove unused packages
run: | run: |
@ -51,4 +45,10 @@ jobs:
dotnet nuget push dest\*.nupkg -s "github" --skip-duplicate dotnet nuget push dest\*.nupkg -s "github" --skip-duplicate
- name: dotnet nuget push to NuGet - name: dotnet nuget push to NuGet
run: dotnet nuget push dest\*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate run: dotnet nuget push dest\*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: add git tag
uses: Klemensas/action-autotag@stable
with:
version: ${{ steps.commonProps.outputs.content }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading…
Cancel
Save