Skip to content

Commit f9b1dc5

Browse files
Initial app image test
1 parent 86a5ad1 commit f9b1dc5

File tree

14 files changed

+370
-53
lines changed

14 files changed

+370
-53
lines changed
Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: .NET Build + Test + Publish
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, appimage]
66
pull_request:
77
branches: [main]
88

99
jobs:
10-
build:
10+
build-windows:
1111
runs-on: windows-2022
1212

1313
steps:
@@ -39,9 +39,6 @@ jobs:
3939
- name: Publish Windows 32bit
4040
if: ${{ github.event_name != 'pull_request' }}
4141
run: dotnet publish --os win --arch x86 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
42-
- name: Publish Linux 64bit
43-
if: ${{ github.event_name != 'pull_request' }}
44-
run: dotnet publish --os linux --arch x64 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
4542
- name: Publish Windows 64bit
4643
if: ${{ github.event_name != 'pull_request' }}
4744
run: dotnet publish -f net9.0
@@ -62,14 +59,78 @@ jobs:
6259
working-directory: setup
6360
run: "./CopyNugetPackages.ps1"
6461
shell: pwsh
65-
- name: Building the Linux 64bit package
66-
if: ${{ github.event_name != 'pull_request' }}
67-
working-directory: setup
68-
run: "./LinuxBuildZipper.ps1"
69-
shell: pwsh
7062
- name: Upload artifact
7163
uses: actions/upload-artifact@v4
7264
if: ${{ github.event_name != 'pull_request' }}
7365
with:
7466
path: "setup/Output/*"
75-
name: MSURandomizer_${{ steps.version.outputs.number }}
67+
name: MSURandomizerWindows
68+
69+
build-linux:
70+
runs-on: ubuntu-22.04
71+
72+
needs: [build-windows]
73+
74+
permissions:
75+
contents: write
76+
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: dsaltares/fetch-gh-release-asset@master
80+
with:
81+
repo: "MattEqualsCoder/ALttPMSUShuffler"
82+
file: "msu_types.json"
83+
target: "MSURandomizerLibrary/msu_types.json"
84+
token: ${{ secrets.GITHUB_TOKEN }}
85+
- name: Setup .NET
86+
uses: actions/setup-dotnet@v4
87+
with:
88+
dotnet-version: 9.0.x
89+
- name: Install PupNet
90+
run: dotnet tool install -g KuiperZone.PupNet
91+
- name: Download AppImageTool
92+
run: |
93+
wget -P "$HOME/.local/bin" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
94+
chmod +x "$HOME/.local/bin/appimagetool-x86_64.AppImage"
95+
appimagetool-x86_64.AppImage --version
96+
- name: Run PupNet
97+
run: pupnet Setup/AppImage.pupnet.conf --kind appimage -y
98+
- name: Upload artifact
99+
uses: actions/upload-artifact@v4
100+
if: ${{ github.event_name != 'pull_request' }}
101+
with:
102+
path: "Setup/Output/MSURandomizer*"
103+
name: MSUScripterLinux
104+
105+
package:
106+
runs-on: ubuntu-22.04
107+
108+
needs: [build-windows, build-linux]
109+
110+
permissions:
111+
contents: write
112+
113+
steps:
114+
- uses: actions/download-artifact@v5
115+
with:
116+
name: MSURandomizerWindows
117+
path: out
118+
- uses: actions/download-artifact@v5
119+
with:
120+
name: MSURandomizerLinux
121+
path: out
122+
- name: Extract some files
123+
run: |
124+
ls -alR
125+
- name: Upload artifact
126+
uses: actions/upload-artifact@v4
127+
if: ${{ github.event_name != 'pull_request' }}
128+
with:
129+
path: "out/*"
130+
name: MSURandomizer_${{ needs.build-windows.outputs.version-number }}
131+
- name: Delete old artifacts
132+
uses: geekyeggo/delete-artifact@v5
133+
with:
134+
name: |
135+
MSURandomizerWindows
136+
MSURandomizerLinux

MSURandomizer/Assets/icon.128.png

1000 Bytes
Loading

MSURandomizer/Assets/icon.16.png

714 Bytes
Loading

MSURandomizer/Assets/icon.24.png

726 Bytes
Loading

MSURandomizer/Assets/icon.256.png

1.37 KB
Loading

MSURandomizer/Assets/icon.32.png

748 Bytes
Loading

MSURandomizer/Assets/icon.48.png

784 Bytes
Loading

MSURandomizer/Assets/icon.64.png

838 Bytes
Loading

MSURandomizer/Assets/icon.svg

Lines changed: 38 additions & 0 deletions
Loading

MSURandomizer/Services/CurrentPlayingTrackService.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,26 @@ public void StartMarquee(double innerWidth, double outerWidth)
5858
{
5959
if (innerWidth < outerWidth)
6060
return;
61-
62-
Model.MaxTicks = (innerWidth - outerWidth) / 50 * 30;
63-
Model.TargetMargin = outerWidth - innerWidth;
61+
62+
Dispatcher.UIThread.Post(() =>
63+
{
64+
Model.MaxTicks = (innerWidth - outerWidth) / 50 * 30;
65+
Model.TargetMargin = outerWidth - innerWidth;
66+
});
6467
_ = StartTimer();
6568
}
6669

6770
private async Task StartTimer()
6871
{
69-
Model.Ticks = 0;
70-
Model.AnimationMargin = new Thickness(0);
72+
Dispatcher.UIThread.Post(() =>
73+
{
74+
Model.Ticks = 0;
75+
Model.AnimationMargin = new Thickness(0);
76+
});
7177
var cts = _cts = new CancellationTokenSource();
7278
await Task.Delay(TimeSpan.FromSeconds(3), cts.Token);
7379
if (cts.IsCancellationRequested) return;
74-
_dispatcherTimer?.Start();
80+
Dispatcher.UIThread.Post(() => { _dispatcherTimer?.Start(); });
7581
}
7682

7783
private async Task RestartTimer()
@@ -96,9 +102,14 @@ private void MsuMonitorServiceOnMsuTrackChanged(object sender, MsuTrackChangedEv
96102
private void ChangeMessage(string message)
97103
{
98104
_cts.Cancel();
99-
_dispatcherTimer?.Stop();
100-
Model.AnimationMargin = new Thickness(0);
101-
Model.Message = message;
105+
106+
Dispatcher.UIThread.Post(() =>
107+
{
108+
_dispatcherTimer?.Stop();
109+
Model.AnimationMargin = new Thickness(0);
110+
Model.Message = message;
111+
});
112+
102113
TrackChanged?.Invoke(this, EventArgs.Empty);
103114
}
104115

0 commit comments

Comments
 (0)