mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
add workflows, app versioning
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build and publish application
|
||||||
|
|
||||||
|
on: workflow_run
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get Application Version
|
||||||
|
run: |
|
||||||
|
echo "PKG_PREPEND=MercuryConverter-v$(cat src/Assets/version)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup dotnet 9.0.x
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
|
|
||||||
|
- name: Build for Linux
|
||||||
|
run: |
|
||||||
|
dotnet publish src --runtime linux-x64 -o "./builds/${{ env.PKG_PREPEND }}-linux-x64"
|
||||||
|
zip -r "${{ env.PKG_PREPEND }}-linux-x64.zip" "./builds/${{ env.PKG_PREPEND }}-linux-x64"
|
||||||
|
|
||||||
|
- name: Build for Windows
|
||||||
|
run: |
|
||||||
|
dotnet publish src --runtime win-x64 -o "./builds/${{ env.PKG_PREPEND }}-windows-x64"
|
||||||
|
zip -r "${{ env.PKG_PREPEND }}-windows-x64.zip" "./builds/${{ env.PKG_PREPEND }}-windows-x64"
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: ncipollo/release-action@v1.19.1
|
||||||
|
with:
|
||||||
|
allowUpdates: true
|
||||||
|
commit: main
|
||||||
|
artifacts: "${{ env.PKG_PREPEND }}-linux-x64.zip, ${{ env.PKG_PREPEND }}-windows-x64.zip"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
@@ -39,7 +39,7 @@ public static class Database
|
|||||||
{
|
{
|
||||||
AudioPaths.Clear();
|
AudioPaths.Clear();
|
||||||
|
|
||||||
using (var reader = new StreamReader(Utils.AssetPath("awb.csv")))
|
using (var reader = new StreamReader(Utils.GetAsset("awb.csv")))
|
||||||
{
|
{
|
||||||
string? line;
|
string? line;
|
||||||
while ((line = reader.ReadLine()) != null)
|
while ((line = reader.ReadLine()) != null)
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ public partial class ExportRow : ObservableObject
|
|||||||
{
|
{
|
||||||
private static Dictionary<ExportStatus, IImage?> StatusImgs = new()
|
private static Dictionary<ExportStatus, IImage?> StatusImgs = new()
|
||||||
{
|
{
|
||||||
{ ExportStatus.Working, new Bitmap(Utils.AssetPath("imgs/status/indeterminate_spinner.png")) },
|
{ ExportStatus.Working, new Bitmap(Utils.GetAsset("imgs/status/indeterminate_spinner.png")) },
|
||||||
{ ExportStatus.Error, new Bitmap(Utils.AssetPath("imgs/status/task_error.png")) },
|
{ ExportStatus.Error, new Bitmap(Utils.GetAsset("imgs/status/task_error.png")) },
|
||||||
{ ExportStatus.Finished, new Bitmap(Utils.AssetPath("imgs/status/task_complete.png")) },
|
{ ExportStatus.Finished, new Bitmap(Utils.GetAsset("imgs/status/task_complete.png")) },
|
||||||
{ ExportStatus.FinishedWithMessages, new Bitmap(Utils.AssetPath("imgs/status/task_alert.png")) },
|
{ ExportStatus.FinishedWithMessages, new Bitmap(Utils.GetAsset("imgs/status/task_alert.png")) },
|
||||||
};
|
};
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
@@ -111,7 +111,6 @@ public partial class Export : Panel
|
|||||||
{
|
{
|
||||||
if (Exporting) return;
|
if (Exporting) return;
|
||||||
|
|
||||||
Console.WriteLine("Updating rows!");
|
|
||||||
Rows.Clear();
|
Rows.Clear();
|
||||||
|
|
||||||
if ((bool)RadioExportAll.IsChecked!)
|
if ((bool)RadioExportAll.IsChecked!)
|
||||||
|
|||||||
+24
-2
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Platform;
|
using Avalonia.Platform;
|
||||||
@@ -49,7 +50,7 @@ public static class Utils
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="path">Forward-slash (/)-separated path to asset.</param>
|
/// <param name="path">Forward-slash (/)-separated path to asset.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Stream AssetPath(string path) => AssetLoader.Open(new Uri("avares://MercuryConverter/Assets/" + path));
|
public static Stream GetAsset(string path) => AssetLoader.Open(new Uri(Path.Combine("avares://MercuryConverter/Assets/", path)));
|
||||||
|
|
||||||
public static string IIDToMusicFilePath(uint id)
|
public static string IIDToMusicFilePath(uint id)
|
||||||
{
|
{
|
||||||
@@ -82,10 +83,14 @@ public static class Utils
|
|||||||
Console.WriteLine($"Could not find FFmpeg on PATH!");
|
Console.WriteLine($"Could not find FFmpeg on PATH!");
|
||||||
_ffmpegAvailable = false;
|
_ffmpegAvailable = false;
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Something's wrong with FFmpeg!\n{ex.Message}");
|
||||||
|
_ffmpegAvailable = false;
|
||||||
|
}
|
||||||
|
|
||||||
Console.WriteLine($"FFmpeg available: {_ffmpegAvailable}");
|
Console.WriteLine($"FFmpeg available: {_ffmpegAvailable}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (bool)_ffmpegAvailable!;
|
return (bool)_ffmpegAvailable!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,4 +99,21 @@ public static class Utils
|
|||||||
{
|
{
|
||||||
return string.Concat(filename.Split(['/', '\\', '\"', '\'']));
|
return string.Concat(filename.Split(['/', '\\', '\"', '\'']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string? _version = null;
|
||||||
|
public static string VERSION
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_version == null)
|
||||||
|
{
|
||||||
|
using (StreamReader reader = new(GetAsset("version")))
|
||||||
|
{
|
||||||
|
_version = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
_version = _version.Trim();
|
||||||
|
}
|
||||||
|
return _version!;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user