-
Notifications
You must be signed in to change notification settings - Fork 34
95 lines (86 loc) · 4.46 KB
/
linux.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build Linux
on:
workflow_dispatch:
inputs:
VERSION:
description: 'Version'
required: true
BINARY_BRANCH:
description: 'Binary branch'
required: true
NEED_NUPKG:
description: 'Use self nupkg'
type: boolean
required: true
default: false
jobs:
linux-deb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Download NuGet package
if: ${{ inputs.NEED_NUPKG }}
run: |
wget https://github.com/Uotan-Dev/SukiUI-Uotan/releases/download/v6.0.0/SukiUI.6.0.0.nupkg
dotnet nuget add source "/home/runner/work/UotanToolboxNT"
nuget add SukiUI.6.0.0.nupkg -Source /home/runner/work/UotanToolboxNT
- name: Clone Binary
run: git clone https://github.com/Uotan-Dev/UotanToolboxNT.Binary.git -b ${{ inputs.BINARY_BRANCH }}
- name: Build
run: |
dotnet publish -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o ./publish-x64
dotnet publish -r linux-arm64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o ./publish-arm64
- name: Make deb-x64
run: |
mkdir staging_folder
mkdir ./staging_folder/DEBIAN
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/control-x64 ./staging_folder/DEBIAN/control
mkdir ./staging_folder/usr
mkdir ./staging_folder/usr/bin
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/UotanToolbox ./staging_folder/usr/bin/UotanToolbox
chmod +x ./staging_folder/usr/bin/UotanToolbox
mkdir ./staging_folder/usr/lib
mkdir ./staging_folder/usr/lib/UotanToolbox
cp -r ./UotanToolboxNT.Binary/Linux_AMD64/* ./staging_folder/usr/lib/UotanToolbox/
cp -r ./publish-x64/* ./staging_folder/usr/lib/UotanToolbox/
chmod -R a+rX ./staging_folder/usr/lib/UotanToolbox/
chmod +x ./staging_folder/usr/lib/UotanToolbox/UotanToolbox
mkdir ./staging_folder/usr/share
mkdir ./staging_folder/usr/share/applications
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/UotanToolbox.desktop ./staging_folder/usr/share/applications/UotanToolbox.desktop
mkdir ./staging_folder/usr/share/pixmaps
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/UotanToolbox.png ./staging_folder/usr/share/pixmaps/UotanToolbox.png
dpkg-deb --root-owner-group --build ./staging_folder/ ./UotanToolbox_Linux_x64_${{ inputs.VERSION }}.deb
rm -rf ./staging_folder/*
- name: Make deb-arm64
run: |
mkdir ./staging_folder/DEBIAN
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/control-arm64 ./staging_folder/DEBIAN/control
mkdir ./staging_folder/usr
mkdir ./staging_folder/usr/bin
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/UotanToolbox ./staging_folder/usr/bin/UotanToolbox
chmod +x ./staging_folder/usr/bin/UotanToolbox
mkdir ./staging_folder/usr/lib
mkdir ./staging_folder/usr/lib/UotanToolbox
cp -r ./UotanToolboxNT.Binary/Linux_AArch64/* ./staging_folder/usr/lib/UotanToolbox/
cp -r ./publish-arm64/* ./staging_folder/usr/lib/UotanToolbox/
chmod -R a+rX ./staging_folder/usr/lib/UotanToolbox/
chmod +x ./staging_folder/usr/lib/UotanToolbox/UotanToolbox
mkdir ./staging_folder/usr/share
mkdir ./staging_folder/usr/share/applications
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/UotanToolbox.desktop ./staging_folder/usr/share/applications/UotanToolbox.desktop
mkdir ./staging_folder/usr/share/pixmaps
cp /home/runner/work/UotanToolboxNT/UotanToolboxNT/UotanToolbox/Assets/Linux/UotanToolbox.png ./staging_folder/usr/share/pixmaps/UotanToolbox.png
dpkg-deb --root-owner-group --build ./staging_folder/ ./UotanToolbox_Linux_arm64_${{ inputs.VERSION }}.deb
rm -rf ./staging_folder/*
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Linux-Package
path: ./UotanToolbox_Linux*