-
Notifications
You must be signed in to change notification settings - Fork 6
131 lines (123 loc) · 4.93 KB
/
build.yml
File metadata and controls
131 lines (123 loc) · 4.93 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build
on:
workflow_call:
inputs:
branch-postfix:
required: false
type: string
env:
BUILD: ${{ inputs.branch-postfix == 'master' && 'Release' || 'Debug' }}
jobs:
# increment-version:
# runs-on: ubuntu-latest
# steps:
# - name: Increment Version
# uses: action-pack/increment@v2
# with:
# name: "VERSION"
# token: ${{ secrets.REPO_ACCESS_TOKEN }}
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Increment Version
uses: action-pack/increment@v2
with:
name: "VERSION"
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Build Executables
shell: pwsh
run: |
$startPath = Join-Path (Get-Location) 'src' 'bin' $env:BUILD 'net10.0'
$artifactPath = Join-Path (Get-Location) 'artifacts'
if (!(Test-Path $artifactPath))
{
New-Item $artifactPath -ItemType Directory -Force
}
$env:GITHUB_RUN_ID = $null
dotnet publish -r win-x64 -c $env:BUILD --self-contained --p:PublishAot=true --p:OptimizationPreference=Speed --p:PublishTrimmed=true --p:PublishSingleFile=true --p:PublishReadyToRun=true /p:Version=2.0.${{ vars.VERSION }}
Copy-Item (Join-Path $startPath 'win-x64' 'publish' 'Oxide.Compiler.exe') (Join-Path $artifactPath 'win-x64.AOT.Compiler.exe') -Force
dotnet publish -r win-x64 -c $env:BUILD --self-contained --p:PublishSingleFile=true --p:PublishReadyToRun=true /p:Version=2.0.${{ vars.VERSION }}
Copy-Item (Join-Path $startPath 'win-x64' 'publish' 'Oxide.Compiler.exe') (Join-Path $artifactPath 'win-x64.Compiler.exe') -Force
dotnet publish -r linux-x64 -c $env:BUILD --self-contained --p:PublishSingleFile=true --p:PublishReadyToRun=true /p:Version=2.0.${{ vars.VERSION }}
Copy-Item (Join-Path $startPath 'linux-x64' 'publish' 'Oxide.Compiler') (Join-Path $artifactPath 'linux-x64.Compiler') -Force
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: artifacts/
# build:
# needs: "increment-version"
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 9.0.x
# - name: Build Executables
# shell: pwsh
# run: |
# $env:GITHUB_RUN_ID = $null
# dotnet publish --nologo -c $env:BUILD -r win-x64 -restore --version-suffix test /p:Version=1.0.${{ vars.VERSION }}
# $artifactPath = Join-Path (Get-Location) 'artifacts'
# if (!(Test-Path $artifactPath))
# {
# New-Item $artifactPath -ItemType Directory -Force
# }
# $startPath = Join-Path (Get-Location) 'src' 'bin' $env:BUILD 'net9.0'
# Copy-Item (Join-Path $startPath 'win-x64' 'publish' 'Oxide.Compiler.exe') (Join-Path $artifactPath 'win-x64.Compiler.exe') -Force
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ github.event.repository.name }}-windows
# path: artifacts/
# build-linux:
# needs: "increment-version"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 9.0.x
# - name: Build Executables
# run: |
# dotnet publish --nologo -c ${{ env.BUILD }} -r linux-x64 -restore --version-suffix test /p:Version=1.0.${{ vars.VERSION }}
# mkdir -p artifacts
# cp src/bin/${{ env.BUILD }}/net9.0/linux-x64/publish/Oxide.Compiler artifacts/linux-x64.Compiler
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ github.event.repository.name }}-linux
# path: artifacts/
# build-matrix:
# needs: "increment-version"
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ ubuntu-latest, windows-latest ]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 9.0.x
# - name: Build Executables
# run: |
# dotnet publish --nologo -c ${{ env.BUILD }} -r linux-x64 -restore --version-suffix test /p:Version=1.0.${{ vars.VERSION }}
# mkdir -p artifacts
# cp src/bin/${{ env.BUILD }}/net9.0/linux-x64/publish/Oxide.Compiler artifacts/linux-x64.Compiler
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ github.event.repository.name }}
# path: artifacts/