Skip to content

Commit b4f2ea9

Browse files
Testing actions build and on release.
1 parent f242592 commit b4f2ea9

5 files changed

Lines changed: 144 additions & 4 deletions

File tree

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
env:
11+
DOTNET_VERSION: '9.0.x'
12+
PROJECT_PATH: 'DazContentInstaller/DazContentInstaller.csproj'
13+
ARTIFACT_NAME: 'DazContentInstaller'
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: ${{ env.DOTNET_VERSION }}
27+
28+
- name: Build
29+
run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release
30+
31+
# - name: Test
32+
# run: dotnet test ${{ env.PROJECT_PATH }} --no-build --verbosity normal
33+
# continue-on-error: true
34+
35+
- name: Publish for Windows x64
36+
run: |
37+
dotnet publish ${{ env.PROJECT_PATH }} \
38+
--configuration Release \
39+
--runtime win-x64 \
40+
--output "./publish/win-x64" \
41+
--verbosity normal
42+
43+
- name: Publish for Windows x86
44+
run: |
45+
dotnet publish ${{ env.PROJECT_PATH }} \
46+
--configuration Release \
47+
--runtime win-x86 \
48+
--output "./publish/win-x86" \
49+
--verbosity normal
50+
51+
- name: Create zip archives
52+
run: |
53+
# Create directories for zip files
54+
mkdir -p ./artifacts
55+
56+
# Zip x64 version
57+
cd ./publish/win-x64 && zip -r "../../artifacts/${{ env.ARTIFACT_NAME }}-win-x64.zip" . && cd ../..
58+
59+
# Zip x86 version
60+
cd ./publish/win-x86 && zip -r "../../artifacts/${{ env.ARTIFACT_NAME }}-win-x86.zip" . && cd ../..
61+
62+
- name: Upload build artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: ${{ env.ARTIFACT_NAME }}-builds
66+
path: ./artifacts/*.zip
67+
retention-days: 30
68+
69+
release:
70+
needs: build
71+
runs-on: ubuntu-latest
72+
if: startsWith(github.ref, 'refs/tags/v')
73+
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@v4
77+
78+
- name: Setup .NET
79+
uses: actions/setup-dotnet@v4
80+
with:
81+
dotnet-version: ${{ env.DOTNET_VERSION }}
82+
83+
- name: Publish for Windows x64
84+
run: |
85+
dotnet publish ${{ env.PROJECT_PATH }} \
86+
--configuration Release \
87+
--runtime win-x64 \
88+
--output "./publish/win-x64" \
89+
--verbosity normal
90+
91+
- name: Publish for Windows x86
92+
run: |
93+
dotnet publish ${{ env.PROJECT_PATH }} \
94+
--configuration Release \
95+
--runtime win-x86 \
96+
--output "./publish/win-x86" \
97+
--verbosity normal
98+
99+
- name: Create zip archives
100+
run: |
101+
# Create directories for zip files
102+
mkdir -p ./artifacts
103+
104+
# Zip x64 version
105+
cd ./publish/win-x64 && zip -r "../../artifacts/${{ env.ARTIFACT_NAME }}-${{ github.ref_name }}-win-x64.zip" . && cd ../..
106+
107+
# Zip x86 version
108+
cd ./publish/win-x86 && zip -r "../../artifacts/${{ env.ARTIFACT_NAME }}-${{ github.ref_name }}-win-x86.zip" . && cd ../..
109+
110+
- name: Generate release notes
111+
id: release_notes
112+
run: |
113+
tag="${{ github.ref_name }}"
114+
cat << EOF > ./release_notes.md
115+
## Release $tag
116+
117+
### Downloads
118+
- **Windows x64**: ${{ env.ARTIFACT_NAME }}-$tag-win-x64.zip
119+
- **Windows x86**: ${{ env.ARTIFACT_NAME }}-$tag-win-x86.zip
120+
121+
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...$tag
122+
EOF
123+
124+
echo "notes_file=./release_notes.md" >> $GITHUB_OUTPUT
125+
126+
- name: Create Release
127+
uses: softprops/action-gh-release@v2
128+
with:
129+
files: ./artifacts/*.zip
130+
body_path: ${{ steps.release_notes.outputs.notes_file }}
131+
draft: false
132+
prerelease: ${{ contains(github.ref_name, '-') }}
133+
generate_release_notes: true
-172 KB
Binary file not shown.

DazContentInstaller/DazContentInstaller.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
99
</PropertyGroup>
1010

11+
<!-- Single-file publish configuration -->
12+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
13+
<PublishSingleFile>true</PublishSingleFile>
14+
<SelfContained>true</SelfContained>
15+
<PublishTrimmed>false</PublishTrimmed>
16+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
17+
<DebugType>None</DebugType>
18+
</PropertyGroup>
19+
1120
<ItemGroup>
1221
<AvaloniaResource Include="Assets\**" />
1322
</ItemGroup>

DazContentInstaller/ViewModels/MainWindowViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using DynamicData;
1414
using Microsoft.EntityFrameworkCore;
1515
using ReactiveUI;
16-
using SharpSevenZip;
1716

1817
namespace DazContentInstaller.ViewModels;
1918

@@ -86,7 +85,7 @@ public string InstalledAssetsSearch
8685
private string _installedAssetsSearch = string.Empty;
8786
private int _statusProgress;
8887
private int _statusBarMax = 100;
89-
private IImmutableSolidColorBrush _statusBarColor;
88+
private IImmutableSolidColorBrush _statusBarColor = Brushes.DodgerBlue;
9089

9190
public string StatusText
9291
{

DazContentInstaller/Views/MainWindow.axaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
xmlns:converters="clr-namespace:DazContentInstaller.Converters"
88
mc:Ignorable="d" d:DesignWidth="1600" d:DesignHeight="900" Width="1600" Height="900"
99
x:Class="DazContentInstaller.Views.MainWindow"
10-
x:DataType="vm:MainWindowViewModel"
11-
Icon="/Assets/avalonia-logo.ico" WindowState="Maximized"
10+
x:DataType="vm:MainWindowViewModel" WindowState="Maximized"
1211
Title="DazContentInstaller" Loaded="Control_OnLoaded">
1312

1413
<Window.Resources>

0 commit comments

Comments
 (0)