LANCommander/.github/workflows/LANCommander.Server.Linux.arm64.yml
2024-09-27 00:03:17 -05:00

99 lines
No EOL
5.1 KiB
YAML

name: LANCommander Linux arm64
on:
workflow_dispatch:
workflow_call:
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_RUNTIME: linux-arm64
BUILD_ARCH: arm64
BUILD_PLATFORM: Linux
steps:
- uses: frabert/replace-string-action@v2
name: Trim Tag Ref
id: trim_tag_ref
with:
string: '${{ github.ref }}'
pattern: 'refs/tags/v'
replace-with: ''
- uses: frabert/replace-string-action@v2
name: Swap Path Backslashes
id: swap_path_backslashes
with:
string: '${{ github.workspace }}'
pattern: '\\'
replace-with: '/'
flags: g
# dotnet
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
# Auto Updater
- name: Publish Linux arm64 Updater
run: dotnet publish "./LANCommander.AutoUpdater/LANCommander.AutoUpdater.csproj" -c Release --self-contained --runtime ${{ env.BUILD_RUNTIME }} -p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" -p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
- name: Rename Linux arm64 Updater
run: mv ./LANCommander.AutoUpdater/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/LANCommander.AutoUpdater ./LANCommander.AutoUpdater/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/LANCommander.AutoUpdater.Update
# Node.js
- name: Setup Node.js environment
uses: actions/setup-node@v3.8.1
# UI
- run: cd ./LANCommander.UI; npm install; npm run package
# Linux arm64
- name: Publish Linux
run: dotnet publish "./LANCommander.Server/LANCommander.Server.csproj" -c Release --self-contained --runtime ${{ env.BUILD_RUNTIME }} -p:PublishSingleFile=true -p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" -p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
- name: Remove Extra Files
run: |
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/BootstrapBlazor.PdfReader/compat
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/BootstrapBlazor.PdfReader/2.*
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/BootstrapBlazor.PdfReader/build/pdf.sandbox.js
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/BootstrapBlazor.PdfReader/build/*.map
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/BootstrapBlazor.PdfReader/web/*.map
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/AntDesign/less
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/wwwroot/_content/BlazorMonaco/lib/monaco-editor/min-maps
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/LANCommander.ico
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/LANCommanderDark.ico
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/package-lock.json
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/package.json
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/*.pdb
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/hostfxr.dll.bak
rm -Recurse -Force -ErrorAction Ignore ./LANCommander.Launcher/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/Libraries/locales
- name: Bundle
run: |
Copy-Item -Force LANCommander.AutoUpdater/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/* LANCommander.Server/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/
# Create Linux arm64 ZIP file
- name: Package Linux Build
uses: vimtor/action-zip@v1.2
with:
files: LANCommander.Server/bin/Release/net8.0/${{ env.BUILD_RUNTIME }}/publish/
recursive: true
dest: LANCommander.Server-${{ env.BUILD_PLATFORM }}-${{ env.BUILD_ARCH }}-v${{ steps.trim_tag_ref.outputs.replaced }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: LANCommander.Server-${{ env.BUILD_PLATFORM }}-${{ env.BUILD_ARCH }}-v${{ steps.trim_tag_ref.outputs.replaced }}.zip
name: LANCommander.Server-${{ env.BUILD_PLATFORM }}-${{ env.BUILD_ARCH }}-v${{ steps.trim_tag_ref.outputs.replaced }}.zip