-
Notifications
You must be signed in to change notification settings - Fork 12
99 lines (84 loc) · 3.01 KB
/
nigthly-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
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
92
93
94
95
96
97
98
99
name: Nightly Release
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
uses: ./.github/workflows/build-and-test.yml
extract-nightly-info:
name: Extract Nightly Info
runs-on: ubuntu-latest
needs:
- build
outputs:
full-version: ${{ steps.gen-version.outputs.VERSION }}
no-prefix-version: ${{ steps.gen-version.outputs.NO_PREFIX_VERSION }}
has-nightly: ${{ steps.gen-version.outputs.HAS_NIGHTLY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract Latest Changes
run: ./build/Extract-LatestChanges.ps1
shell: pwsh
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Generate Version Number
id: gen-version
run: |
dotnet run --project src/Tools/NightlyTool --verbosity quiet -- $env:GITHUB_OUTPUT
shell: pwsh
- name: Tag New Nightly
if: steps.gen-version.outputs.HAS_NIGHTLY == 'yes'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag --annotate --file=LATESTCHANGES.md --cleanup=whitespace ${{ steps.gen-version.outputs.VERSION }}
git push origin ${{ steps.gen-version.outputs.VERSION }}
shell: pwsh
release:
name: Release
runs-on: windows-latest
needs:
- build
- extract-nightly-info
if: needs.extract-nightly-info.outputs.has-nightly == 'yes'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release -p:Version=${{ needs.extract-nightly-info.outputs.no-prefix-version }}
- name: Generate NuGet packages
run: dotnet pack --no-restore --configuration Release --output ./packages --include-symbols -p:SymbolPackageFormat=snupkg -p:Version=${{ needs.extract-nightly-info.outputs.no-prefix-version }}
- name: Publish packages
run: |
Get-ChildItem -Path ./packages/ -Filter *.nupkg -File -Name | ForEach-Object {
dotnet nuget push ./packages/$_ --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
}
shell: pwsh
- name: Extract Latest Changes
run: ./build/Extract-LatestChanges.ps1
shell: pwsh
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ needs.extract-nightly-info.outputs.full-version }}
tag_name: ${{ needs.extract-nightly-info.outputs.full-version }}
body_path: LATESTCHANGES.md
prerelease: true