Skip to content

Commit

Permalink
添加自动构建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Sep 17, 2024
1 parent c573f92 commit 1b54871
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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: .NET
name: .NET Test

on:
push:
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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
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: 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/UotanToolbox/Assets/Linux/control-x64 ./staging_folder/DEBIAN/control
mkdir ./staging_folder/usr
mkdir ./staging_folder/usr/bin
cp /home/runner/work/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 -f -a ./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/UotanToolbox/Assets/Linux/UotanToolbox.desktop ./staging_folder/usr/share/applications/UotanToolbox.desktop
mkdir ./staging_folder/usr/share/pixmaps
cp /home/runner/work/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/UotanToolbox/Assets/Linux/control-arm64 ./staging_folder/DEBIAN/control
mkdir ./staging_folder/usr
mkdir ./staging_folder/usr/bin
cp /home/runner/work/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 -f -a ./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/UotanToolbox/Assets/Linux/UotanToolbox.desktop ./staging_folder/usr/share/applications/UotanToolbox.desktop
mkdir ./staging_folder/usr/share/pixmaps
cp /home/runner/work/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*
Empty file added .github/workflows/macos.yml
Empty file.
Empty file added .github/workflows/windows.yml
Empty file.
3 changes: 3 additions & 0 deletions UotanToolbox/Assets/Linux/UotanToolbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec /usr/lib/UotanToolbox/UotanToolbox
11 changes: 11 additions & 0 deletions UotanToolbox/Assets/Linux/UotanToolbox.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Version=3.0.0
Name=UotanToolbox
GenericName=UotanToolbox
Icon=UotanToolbox
Exec=UotanToolbox %F
StartupWMClass=UotanToolbox
Terminal=false
Categories=Development
Keywords=UotanToolbox; Uotan;
Binary file added UotanToolbox/Assets/Linux/UotanToolbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions UotanToolbox/Assets/Linux/control-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Maintainer: mujianwu <[email protected]>
Package: UotanToolbox
Version: 3.0.0
Section: devel
Priority: optional
Architecture: arm64
Essential: no
Installed-Size: 268000
Depends: usbutils, android-tools-adb, gnome-terminal
Description: Advanced, Modern Toolbox for Geeks.
Copyright: 2020-2024 UOTAN
11 changes: 11 additions & 0 deletions UotanToolbox/Assets/Linux/control-loong64
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Maintainer: mujianwu <[email protected]>
Package: UotanToolbox
Version: 3.0.0
Section: devel
Priority: optional
Architecture: loong64
Essential: no
Installed-Size: 268000
Depends: usbutils, android-tools-adb, gnome-terminal
Description: Advanced, Modern Toolbox for Geeks.
Copyright: 2020-2024 UOTAN
11 changes: 11 additions & 0 deletions UotanToolbox/Assets/Linux/control-x64
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Maintainer: mujianwu <[email protected]>
Package: UotanToolbox
Version: 3.0.0
Section: devel
Priority: optional
Architecture: amd64
Essential: no
Installed-Size: 268000
Depends: usbutils, android-tools-adb, gnome-terminal
Description: Advanced, Modern Toolbox for Geeks.
Copyright: 2020-2024 UOTAN
File renamed without changes.
30 changes: 30 additions & 0 deletions UotanToolbox/Assets/macOS/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>UotanToolbox</string>
<key>CFBundleIconFile</key>
<string>Icon</string>
<key>CFBundleIdentifier</key>
<string>com.uotan.toolbox</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>UotanToolbox</string>
<key>CFBundleDisplayName</key>
<string>UotanToolbox</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020-2024 UOTAN All rights reserved.</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0</string>
<key>CFBundleVersion</key>
<string>3.0.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
</dict>
</plist>
1 change: 1 addition & 0 deletions UotanToolbox/Assets/macOS/PkgInfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APPL????

0 comments on commit 1b54871

Please sign in to comment.