-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (35 loc) · 1.3 KB
/
push.yml
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
name: Push
on:
workflow_dispatch:
env:
NUGET_PROJECT_PATH: nuget/NIX.Analyzers
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
jobs:
push:
name: Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dotnet
uses: actions/setup-dotnet@v1
- name: Restore packages
run: dotnet restore ${{ env.NUGET_PROJECT_PATH }}
- name: Build project
run: dotnet build ${{ env.NUGET_PROJECT_PATH }}/NIX.Analyzers.csproj --no-restore
- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Set version
id: version
uses: mad9000/actions-find-and-replace-string@2
with:
source: ${{ steps.previoustag.outputs.tag }}
find: 'v'
replace: ''
- name: Pack project
run: dotnet pack ${{ env.NUGET_PROJECT_PATH }}/NIX.Analyzers.csproj /p:PackageVersion=${{ steps.version.outputs.value }} --no-restore --no-build --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Push package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json