-
Notifications
You must be signed in to change notification settings - Fork 5
91 lines (76 loc) · 3.34 KB
/
main.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# This is a basic workflow to help you get started with Actions
name: CI
concurrency: CI
# https://github.com/irongut/MauiBeach/blob/master/.github/workflows/ci-build.yml
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
pull_request:
branches: [ main ]
permissions:
contents: read
env:
DOTNET_VERSION: '7.x'
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build-tools"
build-tools:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: 🛒 Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: ⚙️ Setup dotnet {{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@master
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
id: nbgv
with:
setAllVars: true
- name: Restore dependancies
run: dotnet restore Tools.sln
- name: 🛠️ Building library in release mode
run: dotnet build Tools.sln --no-restore --configuration Release
# pack and publish the nuget package
- name: Pack NostrKey
run: dotnet pack src/NostrKey/NostrKey.csproj --configuration Release --no-build --output nupkgs -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{env.NBGV_SemVer1}}
# pack and publish the nuget package
- name: Pack NostrLib
run: dotnet pack src/NostrLib/NostrLib.csproj --configuration Release --no-build --output nupkgs -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{env.NBGV_SemVer1}}
- name: Get NuGet
uses: nuget/[email protected]
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
- name: Release artifacts to NuGet
working-directory: ./nupkgs
run : |
nuget push *.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate
- name: Create Release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
[NostrKey NuGet Release v${{ steps.nbgv.outputs.SemVer2 }}](https://www.nuget.org/packages/NostrKey/${{ steps.nbgv.outputs.SemVer2 }})
[NostrLib NuGet Release v${{ steps.nbgv.outputs.SemVer2 }}](https://www.nuget.org/packages/NostrLib/${{ steps.nbgv.outputs.SemVer2 }})
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
release_name: Release v${{ steps.nbgv.outputs.SemVer2 }}
draft: true
prerelease: false