Skip to content

Commit 9a1d5a1

Browse files
committed
CI release builds
1 parent 453d8e1 commit 9a1d5a1

File tree

13 files changed

+246
-14
lines changed

13 files changed

+246
-14
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build VB6
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build-linux-amd64:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: '9.0.x'
23+
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'zulu'
27+
java-version: '21'
28+
29+
- name: Run Tests
30+
run: dotnet test AvaloniaVisualBasic.Runtime.Tests/AvaloniaVisualBasic.Runtime.Tests.csproj
31+
32+
- name: Build AvaloniaVisualBasic.Desktop (Linux)
33+
run: dotnet build AvaloniaVisualBasic.Desktop -f net9.0 -o bin/linux/
34+
35+
- name: Build AvaloniaVisualBasic.Standalone (Linux)
36+
run: dotnet build AvaloniaVisualBasic.Standalone -f net9.0 -o bin/linux/standalone/

.github/workflows/publish.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
build-windows-amd64:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: '9.0.x'
20+
21+
- name: Build and Publish AvaloniaVisualBasic.Desktop (Windows)
22+
run: dotnet publish AvaloniaVisualBasic.Desktop -f net9.0 -o bin/windows/ -p:PublishAot=true -p:PublishTrimmed=true
23+
24+
- name: Build and Publish AvaloniaVisualBasic.Standalone (Windows)
25+
run: dotnet publish AvaloniaVisualBasic.Standalone -f net9.0 -o bin/windows/standalone/ -p:PublishAot=true -p:PublishTrimmed=true
26+
27+
- name: Remove Debug Symbols (Windows)
28+
run: |
29+
find ./bin/windows -name "*.pdb" -type f -delete
30+
find ./bin/windows/standalone -name "*.dll" -type f -delete
31+
mv ./bin/windows/AvaloniaVisualBasic.Desktop.exe ./bin/windows/AvaloniaVisualBasic.exe
32+
shell: bash
33+
34+
- name: Zip Windows Files
35+
run: |
36+
Compress-Archive -Path './bin/windows/*' -DestinationPath './bin/vb6-windows-amd64.zip'
37+
shell: pwsh
38+
39+
- name: Upload Windows Artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: windows-bin
43+
path: ./bin/windows/
44+
45+
- name: Release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
files: ./bin/vb6-windows-amd64.zip
49+
token: ${{ secrets.PAT }}
50+
51+
build-linux-amd64:
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v3
57+
58+
- name: Setup .NET
59+
uses: actions/setup-dotnet@v3
60+
with:
61+
dotnet-version: '9.0.x'
62+
63+
- uses: actions/setup-java@v4
64+
with:
65+
distribution: 'zulu'
66+
java-version: '21'
67+
68+
- name: Build and Publish AvaloniaVisualBasic.Desktop (Linux)
69+
run: dotnet publish AvaloniaVisualBasic.Desktop -f net9.0 -o bin/linux/ -p:PublishAot=true -p:PublishTrimmed=true
70+
71+
- name: Build and Publish AvaloniaVisualBasic.Standalone (Linux)
72+
run: dotnet publish AvaloniaVisualBasic.Standalone -f net9.0 -o bin/linux/standalone/ -p:PublishAot=true -p:PublishTrimmed=true
73+
74+
- name: Remove Debug Symbols (Linux)
75+
run: |
76+
find ./bin/linux -name "*.dbg" -type f -delete
77+
find ./bin/linux -name "*.pdb" -type f -delete
78+
find ./bin/linux/standalone -name "*.so" -type f -delete
79+
chmod +x ./bin/linux/AvaloniaVisualBasic.Desktop
80+
chmod +x ./bin/linux/standalone/AvaloniaVisualBasic.Standalone
81+
mv ./bin/linux/AvaloniaVisualBasic.Desktop ./bin/linux/AvaloniaVisualBasic
82+
83+
- name: Tar files
84+
run: |
85+
cd ./bin/linux
86+
tar -cvf vb6-linux-amd64.tar *
87+
gzip vb6-linux-amd64.tar
88+
cd ../../
89+
90+
- name: Upload Linux Artifacts
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: linux-bin
94+
path: ./bin/linux/vb6-linux-amd64.tar.gz
95+
96+
- name: Release
97+
uses: softprops/action-gh-release@v2
98+
with:
99+
files: ./bin/linux/vb6-linux-amd64.tar.gz
100+
token: ${{ secrets.PAT }}
101+
102+
build-macos-arm64:
103+
runs-on: macos-latest
104+
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v3
108+
109+
- name: Setup .NET
110+
uses: actions/setup-dotnet@v3
111+
with:
112+
dotnet-version: '9.0.x'
113+
114+
- name: Build and Publish AvaloniaVisualBasic.Desktop (macOS)
115+
run: dotnet publish AvaloniaVisualBasic.Desktop -f net9.0 -o bin/macos/ -p:PublishAot=true -p:PublishTrimmed=true
116+
117+
- name: Build and Publish AvaloniaVisualBasic.Standalone (macOS)
118+
run: dotnet publish AvaloniaVisualBasic.Standalone -f net9.0 -o bin/macos/standalone/ -p:PublishAot=true -p:PublishTrimmed=true
119+
120+
- name: Remove Debug Symbols (macOS)
121+
run: |
122+
find ./bin/macos -name "*.dbg" -type f -delete
123+
find ./bin/macos -name "*.pdb" -type f -delete
124+
find ./bin/macos -name "*.dSYM" -type d -exec rm -rf {} +
125+
find ./bin/macos/standalone -name "*.dylib" -type f -delete
126+
chmod +x ./bin/macos/AvaloniaVisualBasic.Desktop
127+
chmod +x ./bin/macos/standalone/AvaloniaVisualBasic.Standalone
128+
mv ./bin/macos/AvaloniaVisualBasic.Desktop ./bin/macos/AvaloniaVisualBasic
129+
130+
- name: Tar files
131+
run: |
132+
cd ./bin/macos
133+
tar -cvf vb6-macos-arm64.tar *
134+
gzip vb6-macos-arm64.tar
135+
cd ../../
136+
137+
- name: Upload macOS Artifacts
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: macos-bin
141+
path: ./bin/macos/vb6-macos-arm64.tar
142+
143+
- name: Release
144+
uses: softprops/action-gh-release@v2
145+
with:
146+
files: ./bin/macos/vb6-macos-arm64.tar.gz
147+
token: ${{ secrets.PAT }}

AvaloniaVisualBasic.Desktop/AvaloniaVisualBasic.Desktop.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<TargetFrameworks>$(DotNetVersionDesktop)</TargetFrameworks>
77
<Nullable>enable</Nullable>
88
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
9+
<ApplicationIcon>vb6icon.ico</ApplicationIcon>
910
</PropertyGroup>
1011

1112
<PropertyGroup>
@@ -21,4 +22,10 @@
2122
<ItemGroup>
2223
<ProjectReference Include="..\AvaloniaVisualBasic\AvaloniaVisualBasic.csproj" />
2324
</ItemGroup>
25+
26+
<ItemGroup>
27+
<AvaloniaResource Include="..\AvaloniaVisualBasic\vb6icon.ico">
28+
<Link>vb6icon.ico</Link>
29+
</AvaloniaResource>
30+
</ItemGroup>
2431
</Project>
1.05 KB
Binary file not shown.

AvaloniaVisualBasic.Standalone/App.axaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Avalonia.Controls;
44
using Avalonia.Controls.ApplicationLifetimes;
55
using Avalonia.Markup.Xaml;
6+
using Avalonia.Platform;
67
using AvaloniaVisualBasic.Runtime;
78
using Classic.Avalonia.Theme;
89
using Classic.CommonControls.Dialogs;
@@ -23,6 +24,7 @@ public override void OnFrameworkInitializationCompleted()
2324
if (Program.StartupForm != null)
2425
{
2526
VBLoader.RunForm(Program.StartupForm, default, out var window);
27+
window.Icon = new WindowIcon(AssetLoader.Open(new Uri("avares://AvaloniaVisualBasic.Standalone/form.ico")));
2628
desktop.MainWindow = window;
2729
}
2830
else
@@ -40,6 +42,7 @@ public override void OnFrameworkInitializationCompleted()
4042
};
4143
window.Content = msgBox;
4244
desktop.MainWindow = window;
45+
window.Icon = new WindowIcon(AssetLoader.Open(new Uri("avares://AvaloniaVisualBasic.Standalone/form.ico")));
4346
msgBox.AcceptRequest += _ => window.Close();
4447
}
4548
}

AvaloniaVisualBasic.Standalone/AvaloniaVisualBasic.Standalone.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
1111
<DebugSymbols>False</DebugSymbols>
1212
<DebugType>None</DebugType>
13+
<ApplicationIcon>form.ico</ApplicationIcon>
1314
</PropertyGroup>
1415

1516
<PropertyGroup>
@@ -33,5 +34,7 @@
3334

3435
<ItemGroup>
3536
<AvaloniaResource Include="Resources\**\*"/>
37+
<None Remove="form.ico" />
38+
<AvaloniaResource Include="form.ico" />
3639
</ItemGroup>
3740
</Project>
1.37 KB
Binary file not shown.

AvaloniaVisualBasic.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{6151C731-2
2020
README.md = README.md
2121
LICENSE = LICENSE
2222
build_cloudflare.sh = build_cloudflare.sh
23+
.github\workflows\publish.yml = .github\workflows\publish.yml
24+
.github\workflows\build.yml = .github\workflows\build.yml
2325
EndProjectSection
2426
EndProject
2527
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvaloniaVisualBasic.Standalone", "AvaloniaVisualBasic.Standalone\AvaloniaVisualBasic.Standalone.csproj", "{0C6BC133-E273-4716-83D1-4FD1B0C14E19}"

AvaloniaVisualBasic/AvaloniaVisualBasic.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@
4242
<None Remove="Icons\**\*.gif"/>
4343
<AvaloniaResource Include="Icons\**\*.gif"/>
4444
<AvaloniaResource Include="Resources\**\*"/>
45+
<None Remove="vb6icon.ico" />
46+
<AvaloniaResource Include="vb6icon.ico" />
4547
</ItemGroup>
4648
</Project>

AvaloniaVisualBasic/IDE/WindowManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ public async Task ShowWindow(IDialog dialog)
8383
{
8484
Content = dialog,
8585
DataContext = dialog,
86-
SizeToContent = SizeToContent.WidthAndHeight
86+
SizeToContent = SizeToContent.WidthAndHeight,
87+
ShowActivated = true,
88+
WindowStartupLocation = WindowStartupLocation.CenterOwner
8789
};
8890

8991
var lifetime = new TaskCompletionSource();
@@ -225,7 +227,9 @@ void DialogOnCloseRequested(bool result)
225227
{
226228
Content = dialog,
227229
DataContext = dialog,
228-
SizeToContent = SizeToContent.WidthAndHeight
230+
SizeToContent = SizeToContent.WidthAndHeight,
231+
ShowActivated = true,
232+
WindowStartupLocation = WindowStartupLocation.CenterOwner
229233
};
230234
return await window.ShowDialog<bool>(GetTopWindow(desktop));
231235
}

0 commit comments

Comments
 (0)