-
Notifications
You must be signed in to change notification settings - Fork 68
73 lines (63 loc) · 2.32 KB
/
.build.yml
File metadata and controls
73 lines (63 loc) · 2.32 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
name: Build UnityDataTool
on:
workflow_dispatch:
inputs:
environment:
description: 'Build environment'
default: 'release'
required: true
type: choice
options:
- debug
- release
push:
branches:
- main
env:
environment: ${{ inputs.environment || 'release' }}
jobs:
build:
strategy:
matrix:
os: [windows, macos]
arch: [x64, arm64]
exclude:
- os: windows
arch: arm64
- os: macos
arch: x64
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Publish UnityDataTool (${{ matrix.os }}-${{ matrix.arch }}-${{ env.environment }})
run: >
dotnet publish UnityDataTool
-c ${{ env.environment }}
-a ${{ matrix.arch }}
-p:PublishSingleFile=true
-p:UseAppHost=true
-o publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}
- name: Remove platform-specific and debug files (Windows)
if: matrix.os == 'windows'
run: |
Remove-Item -Path "publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/*.dylib" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/*.so" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/*.pdb" -Force -ErrorAction SilentlyContinue
shell: pwsh
- name: Remove platform-specific and debug files (macOS)
if: matrix.os == 'macos'
run: |
rm -f publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/UnityFileSystemApi.dll
rm -f publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/*.so
rm -f publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/*.pdb
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}-${{ env.environment }}
path: publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}