-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (42 loc) · 1.81 KB
/
cd.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
name: CD
on:
workflow_dispatch:
push:
branches: ["main"]
paths:
- 'src/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: "5.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Publish
run: dotnet publish ./src/tye/tye.csproj -c Release -o ./tye2-publish --no-restore -p:AssemblyVersion=${{ steps.gitversion.outputs.AssemblySemVer }} -p:FileVersion=${{ steps.gitversion.outputs.AssemblySemFileVer }} -p:InformationalVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }}
- name: Pack
run: dotnet pack ./src/tye/tye.csproj -c Release -o ./tye2-pack --no-restore -p:AssemblyVersion=${{ steps.gitversion.outputs.AssemblySemVer }} -p:FileVersion=${{ steps.gitversion.outputs.AssemblySemFileVer }} -p:InformationalVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} -p:Version=${{ steps.gitversion.outputs.NuGetVersionV2 }}
- name: Push to nuget
run: dotnet nuget push ./tye2-pack/tye2.${{ steps.gitversion.outputs.NuGetVersionV2 }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- uses: actions/upload-artifact@v4
with:
name: tye2-${{ steps.gitversion.outputs.NuGetVersionV2 }}.zip
path: ./tye2-publish