LANCommander/.github/workflows/LANCommander.Release.yml
2024-01-13 19:23:34 -06:00

106 lines
4.9 KiB
YAML

name: LANCommander Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
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: ''
# Server
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Setup Node.js environment
uses: actions/setup-node@v3.8.1
- run: cd LANCommander/wwwroot/scripts; npm install
# Windows
- name: Publish Windows
run: dotnet publish "./LANCommander/LANCommander.csproj" -c Release -o _Build_Windows --self-contained --os win -p:PublishSingleFile=true -p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" -p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
- name: Publish Windows Updater
run: dotnet publish "./LANCommander.AutoUpdater/LANCommander.AutoUpdater.csproj" -c Release -o _Build_Windows --self-contained --os win -p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" -p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
- name: Rename Windows Updater
run: mv ./_Build_Windows/LANCommander.AutoUpdater.exe ./_Build_Windows/LANCommander.AutoUpdater.exe.Update
- name: Remove Windows Extra Files
run: rm -Recurse -Force ./_Build_Windows/wwwroot/_content/AntDesign/less
# Linux
- name: Publish Linux
run: dotnet publish "./LANCommander/LANCommander.csproj" -c Release -o _Build_Linux --self-contained --os linux -p:PublishSingleFile=true -p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" -p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
# - name: Publish Linux Updater
# run: dotnet publish "./LANCommander.AutoUpdater/LANCommander.AutoUpdater.csproj" -c Release -o _Build_Linux --self-contained --os linux -p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" -p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
# - name: Rename Linux Updater
# run: mv ./_Build_Linux/LANCommander.AutoUpdater ./_Build_Linux/LANCommander.AutoUpdater.Update
- name: Remove Linux Extra Files
run: rm -Recurse -Force ./_Build_Linux/wwwroot/_content/AntDesign/less
- name: Tar Linux
run: tar -cvf LANCommander-Linux-x64-v${{ steps.trim_tag_ref.outputs.replaced }}.tar ./_Build_Linux
# Sign Windows Binary
- name: Sign Windows Binary
uses: nadeemjazmawe/Sign-action-signtool.exe@v0.1
with:
certificate: "${{ secrets.CERTIFICATE }}"
cert-password: "${{ secrets.CERTIFICATE_PASSWORD }}"
filepath: "./_Build_Windows/LANCommander.exe"
- name: Upload Artifacts (Windows)
uses: actions/upload-artifact@v2
with:
name: LANCommander-Windows-x64-v${{ steps.trim_tag_ref.outputs.replaced }}
path: "./_Build_Windows"
- name: Upload Artifacts (Linux)
uses: actions/upload-artifact@v2
with:
name: LANCommander-Linux-x64-v${{ steps.trim_tag_ref.outputs.replaced }}
path: "LANCommander-Linux-x64-v${{ steps.trim_tag_ref.outputs.replaced }}.tar"
# Client
- uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.3.1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.1.1
- name: Restore NuGet packages
run: nuget restore LANCommander.sln
- name: Build and Publish Library
run: msbuild LANCommander.Playnite.Extension/LANCommander.PlaynitePlugin.csproj /p:Configuration=Release /p:OutputPath=Build /p:Version="${{ steps.trim_tag_ref.outputs.replaced }}" /p:AssemblyVersion="${{ steps.trim_tag_ref.outputs.replaced }}"
- name: Sign Windows Binary
uses: nadeemjazmawe/Sign-action-signtool.exe@v0.1
with:
certificate: "${{ secrets.CERTIFICATE }}"
cert-password: "${{ secrets.CERTIFICATE_PASSWORD }}"
filepath: "./LANCommander.Playnite.Extension/Build/LANCommander.PlaynitePlugin.dll"
- name: Download Playnite Release
uses: robinraju/release-downloader@v1.7
with:
repository: JosefNemec/Playnite
tag: 10.32
fileName: Playnite1032.zip
- name: Extract Playnite
run: Expand-Archive -Path Playnite1032.zip -DestinationPath Playnite
- name: Update Manifest Versioning
uses: fjogeleit/yaml-update-action@main
with:
valueFile: "LANCommander.Playnite.Extension/Build/extension.yaml"
propertyPath: "Version"
value: "${{ steps.trim_tag_ref.outputs.replaced }}"
commitChange: false
- name: Run Playnite Toolbox
run: Playnite/Toolbox.exe pack LANCommander.Playnite.Extension/Build .
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: LANCommander.PlaynitePlugin-v${{ steps.trim_tag_ref.outputs.replaced }}
path: LANCommander.PlaynitePlugin_48e1bac7-e0a0-45d7-ba83-36f5e9e959fc_*.pext
# Release