-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (44 loc) · 1.46 KB
/
build.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
name: build and pack
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install Dotnet Tool
run: |
dotnet tool install -g Passingwind.Git-CI-Tools
gitci --version
- name: Set environment variables
uses: rlespinasse/[email protected]
- name: Version check and generate
run: |
gitci release changes --output ./changeslog.md
gitci version next --format json --output ./version.json --build-ver "${{env.GITHUB_SHA_SHORT}}"
ls ./
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Pack
run: dotnet pack --no-build --no-restore -c Release /p:Version="${{env.GITCI_NEXT_VERSION}}" -o ./
- name: Push package
run: dotnet nuget push ./*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: v${{env.GITCI_NEXT_VERSION}}
artifacts: ./*.nupkg, ./changeslog*
bodyFile: ./changeslog.md
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}