Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr.Abc committed Sep 1, 2024
1 parent a1e2ccc commit 0ce7045
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 11 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release File

on:
push:
tags:
- 'v*'

jobs:

build:

strategy:
matrix:
os: [ubuntu, windows, macos]
arch: [x64]

runs-on: ${{ matrix.os }}-latest

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Publish
shell: pwsh
run: cd scripts && ./publish-all.ps1 -os ${{ matrix.os }} -arch ${{ matrix.arch }}

- name: Zipping All
if: matrix.os == 'windows'
uses: vimtor/action-zip@v1
with:
files: ./build
dest: HLC.Net-${{ matrix.os }}-${{ matrix.arch }}.zip

- name: Tarball All
if: matrix.os != 'windows'
run: tar -czvf ./HLC.Net-${{ matrix.os }}-${{ matrix.arch }}.tar.gz ./build

- name: Create Release Unix
if: matrix.os != 'windows' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: HLC.Net-${{ github.ref }}
files: |
./HLC.Net-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
- name: Create Release Win
if: matrix.os == 'windows' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: HLC.Net-${{ github.ref }}
files: |
HLC.Net-${{ matrix.os }}-${{ matrix.arch }}.zip
4 changes: 2 additions & 2 deletions Assets/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
<value>Exit</value>
</data>
<data name="Content_ImageWidth" xml:space="preserve">
<value>Image Width:</value>
<value>Img Width:</value>
</data>
<data name="Content_ImageHeight" xml:space="preserve">
<value>Image Height:</value>
<value>Img Height:</value>
</data>
<data name="Content_ImageMaxOut" xml:space="preserve">
<value>Max</value>
Expand Down
6 changes: 6 additions & 0 deletions HLC.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
</PropertyGroup>

<PropertyGroup>
<PublishAot>true</PublishAot>
<PublishTrimmed>true</PublishTrimmed>
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
Expand Down
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# HLC.Net<img src="Assets/logo.png" align="right" width="120"/>

Yet another spray creator for half-life series game (counter-strike, sven co-op, etc.)

![Downloads](https://img.shields.io/github/downloads/DrAbcOfficial/HLC.Net/total?style=for-the-badge)
![Repo Size](https://img.shields.io/github/repo-size/DrAbcOfficial/HLC.Net?style=for-the-badge)
![Last Commit](https://img.shields.io/github/last-commit/DrAbcOfficial/HLC.Net?style=for-the-badge)


----
# ✅Getting Start

- [中文](READMECN.md)
- Before you use this, will need install
- Grab prebuild binary from [release](https://github.com/DrAbcOfficial/HLC.Net/releases), x64 only


----

# ❓️Why

- HLC spray creator can not run win11 properly any more


# 💡HLC

- [HLC](https://gamebanana.com/tools/5184)

# 💁🏻How to use

1. just like HLC, open an image and apply resize
2. save

# This repository used:

1. [AvaloniaUI](https://avaloniaui.net/)
2. [ImageSharp](https://github.com/SixLabors/ImageSharp)
36 changes: 36 additions & 0 deletions READMECN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# HLC.Net<img src="Assets/logo.png" align="right" width="120"/>

又一个 half-life 系列游戏的喷漆制作器 (counter-strike, sven co-op, etc.)

![Downloads](https://img.shields.io/github/downloads/DrAbcOfficial/HLC.Net/total?style=for-the-badge)
![Repo Size](https://img.shields.io/github/repo-size/DrAbcOfficial/HLC.Net?style=for-the-badge)
![Last Commit](https://img.shields.io/github/last-commit/DrAbcOfficial/HLC.Net?style=for-the-badge)


----
# ✅快速开始

-[release](https://github.com/DrAbcOfficial/HLC.Net/releases)获取预编译的执行文件,仅提供X64架构


----

# ❓️Why

- 原始的HLC 制作器已经不能在Win11正常工作


# 💡HLC

- [HLC](https://gamebanana.com/tools/5184)

# 💁🏻怎么用

1. 就像HLC一样,选择一张图片,重新缩放后应用
2. 保存

# 这个储存库使用了

1. [AvaloniaUI](https://avaloniaui.net/)
2. [ImageSharp](https://github.com/SixLabors/ImageSharp)
19 changes: 10 additions & 9 deletions Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Platform.Storage;
using Avalonia.Styling;
using HLC.Net.Setting;
using HLC.Net.ViewModels;
using MsBox.Avalonia;
using MsBox.Avalonia.Dto;
using MsBox.Avalonia.Enums;
using MsBox.Avalonia.Models;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
Expand All @@ -21,7 +18,6 @@
using System.IO;
using System.Linq;
using System.Text;
using Color = Avalonia.Media.Color;

namespace HLC.Net.Views;

Expand Down Expand Up @@ -225,7 +221,7 @@ static int RequiredPadding(int length, int padToMultipleOf)
}
int pad = RequiredPadding((int)sw.BaseStream.Position, 4);
//dummy pad
for(int i = 0; i < pad; i++)
for (int i = 0; i < pad; i++)
{
sw.Write((byte)0x00);
}
Expand Down Expand Up @@ -261,9 +257,11 @@ static int RequiredPadding(int length, int padToMultipleOf)
}
public async void Button_OpenConfig(object sender, RoutedEventArgs args)
{
var createNew = new ConfigWindow();
var createNewData = new ConfigWindowViewModel();
createNew.DataContext = createNewData;
var createNew = new ConfigWindow
{
DataContext = new ConfigWindowViewModel(),
Position = Position
};
await createNew.ShowDialog(this);
}
public void Button_OpenHelp(object sender, RoutedEventArgs args)
Expand All @@ -276,7 +274,10 @@ public void Button_OpenHelp(object sender, RoutedEventArgs args)
}
public async void Button_OpenAbout(object sender, RoutedEventArgs args)
{
var createNew = new AboutWindow();
var createNew = new AboutWindow
{
Position = Position
};
await createNew.ShowDialog(this);
}
public void Button_Exit(object sender, RoutedEventArgs args)
Expand Down
36 changes: 36 additions & 0 deletions scripts/publish-all.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
param(
[Parameter()]
[String]$arch = "x64",
[String]$os = "windows"
)
$sharpos = ""
switch ($os)
{
"windows" {$sharpos = "win"}
"macos" {$sharpos = "osx"}
"ubuntu" {$sharpos = "linux"}
}
$sharpr = @("$sharpos-$arch")

Set-Location ".."
$callparam = "-r", $sharpr, "-c", "Release", "-o", ".\build", "--self-contained", "true"
if (Test-Path -Path ".\build" -PathType Container) {
Remove-Item ".\build" -Force -Recurse
}
New-Item ".\build" -ItemType "directory"

&"dotnet" "publish" $callparam
Copy-Item -Path @("build") -Destination ".." -Recurse -Exclude "*.pdb" -Force

switch ($os)
{
"windows" {

}
"macos" {

}
"ubuntu" {

}
}

0 comments on commit 0ce7045

Please sign in to comment.