-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 2.1 KB
/
nightly-release.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
name: Nightly MyGet Package Deploy
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
steps:
- name: Setup .Net
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
- uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- run: |
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}"
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.CommitsSinceVersionSourcePadded }}"
- name: Restore with .Net
run: dotnet restore --nologo
- name: Build with .Net
run: dotnet build --configuration Release --no-restore --nologo "-p:Version=${{ steps.gitversion.outputs.NuGetVersionV2 }}"
- name: Pack with .Net
run: |
dotnet pack --nologo --no-build --configuration Release --output nuget-packages -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} src/ReportingApi/ReportingApi.csproj
- uses: actions/upload-artifact@v4
with:
name: Nuget-packages-${{ steps.gitversion.outputs.NuGetVersionV2 }}
path: nuget-packages
- name: Push package to Myget
if: ${{ vars.USE_MYGET == 'true' }}
run: dotnet nuget push 'nuget-packages/*.nupkg' --api-key ${{ secrets.MYGET_API_KEY }} --source https://www.myget.org/F/reporting-api/api/v3/index.json
- name: Push package to Feedz
if: ${{ vars.USE_FEEDZ == 'true' }}
run: dotnet nuget push 'nuget-packages/*.nupkg' --api-key ${{ secrets.FEEDZ_API_KEY }} --source https://f.feedz.io/aviationexam/reporting-api/nuget/index.json