forked from Kirollos/Oxide.Ext.Discord
-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (46 loc) · 1.89 KB
/
develop.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: Create Pre Release Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+-preview.[0-9]+.[0-9]+.[0-9]"
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Set VERSION variable from latest release
shell: pwsh
run: |
$env:VERSION = gh release list --limit 1 --json tagName --jq '.[0].tagName'
if ([string]::IsNullOrEmpty($env:VERSION)) {
Write-Error "Error: VERSION is empty."
exit 1
}
$versionPattern = '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z\-\.]+)?(\+[0-9A-Za-z\-\.]+)?$'
if ($env:VERSION -notmatch $versionPattern) {
Write-Error "Error: VERSION is not a valid Semantic Version (https://semver.org)."
exit 1
} else {
Write-Host "VERSION: $env:VERSION"
echo "VERSION=$env:VERSION" >> $env:GITHUB_ENV
}
env:
GITHUB_REF: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download References
shell: pwsh
run: .\Download-References.ps1
- name: Build DLL (Oxide)
run: dotnet build Oxide.Ext.Discord.csproj -c Release /p:Platform=Oxide /p:Version=$env:VERSION /p:BuildServer=Github -f net48
working-directory: Oxide.Ext.Discord
# - name: Build DLL (Carbon)
# run: dotnet build Oxide.Ext.Discord.csproj -c Release /p:Platform=Carbon /p:Version=$env:VERSION /p:BuildServer=Github -f net48
# working-directory: Oxide.Ext.Discord
- name: Upload Release Assets
run: gh release upload --clobber $env:VERSION Oxide.Ext.Discord/bin/Release/net48/Oxide.Ext.Discord.dll #Oxide.Ext.Discord/bin/Carbon/Release/net48/Carbon.Discord.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}