-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.56 KB
/
publish.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
name: Publish Application
on:
pull_request:
types: [ closed ]
branches: [ "main" ]
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Update version record
run: sed -i -e "s/0.0.0/${{ github.event.pull_request.title }}/g" OrnaLibs.Utils.csproj
- name: Install dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Auth GitHub NuGet
run: dotnet nuget add source --username OrnarasUS --password ${{ secrets.TOKEN_GITHUB }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/OrnarasUS/index.json"
- name: Build project
run: dotnet build
- name: Set variables
id: vars
run: |
echo "nupkg=bin/Debug/$(ls bin/Debug | grep '\.nupkg')" >> $GITHUB_OUTPUT
echo "dll=bin/Debug/net8.0/$(ls bin/Debug/net8.0 | grep '\.dll')" >> $GITHUB_OUTPUT
- name: Publish to NuGet
run: |
dotnet nuget push ${{ steps.vars.outputs.nupkg }} --source "github"
dotnet nuget push ${{ steps.vars.outputs.nupkg }} --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
- name: Publish to GitHub Release
uses: softprops/action-gh-release@v2
with:
repository: OrnarasUS/OrnaLibs.Utils
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
files: ${{ steps.vars.outputs.dll }}
name: ${{ github.event.pull_request.title }}
tag_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}