-
Notifications
You must be signed in to change notification settings - Fork 14
75 lines (64 loc) · 2.34 KB
/
Copy pathrelease.yml
File metadata and controls
75 lines (64 loc) · 2.34 KB
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
name: Release
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Create yafsrc junction
shell: pwsh
run: ./init-yafsrc.ps1
- name: Determine release version
id: version
shell: pwsh
run: ./.github/scripts/Get-ReleaseInfo.ps1
- name: Check for existing release
id: check
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.version.outputs.tag }}
run: |
$ErrorActionPreference = 'Continue'
$PSNativeCommandUseErrorActionPreference = $false
gh release view $env:TAG *>$null
$exists = if ($LASTEXITCODE -eq 0) { 'true' } else { 'false' }
"exists=$exists" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
exit 0
- name: Setup MSBuild
if: steps.check.outputs.exists != 'true'
uses: microsoft/setup-msbuild@v3
- name: Build YAFNET
if: steps.check.outputs.exists != 'true'
working-directory: yafsrc
run: dotnet build YetAnotherForum.NET/YAF-SqlServer.csproj /p:Configuration=Release /p:WarningLevel=0
- name: Restore
if: steps.check.outputs.exists != 'true'
working-directory: yaf_dnn
run: dotnet restore YAF.DNN.Module.slnx
- name: Build DNN package
if: steps.check.outputs.exists != 'true'
working-directory: yaf_dnn
run: msbuild YAF.DNN.Module.slnx /p:Configuration=Release /t:Build "/p:WarningLevel=0;CreateDnnPackages=true"
- name: Create GitHub Release
if: steps.check.outputs.exists != 'true'
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.version.outputs.tag }}
TITLE: ${{ steps.version.outputs.title }}
NOTES_FILE: ${{ steps.version.outputs.notesFile }}
run: |
$assets = Get-ChildItem -Path "yaf_dnn/deploy/*.zip" | ForEach-Object { $_.FullName }
if (-not $assets) {
throw "No release assets found in yaf_dnn/deploy/"
}
gh release create $env:TAG @assets --title $env:TITLE --notes-file $env:NOTES_FILE --target $env:GITHUB_SHA