Skip to content

Commit 5233b69

Browse files
committed
first commit
0 parents  commit 5233b69

13 files changed

Lines changed: 1747 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Release StickyNote Installers
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch: {}
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-release:
14+
runs-on: windows-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET 8
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: '8.0.x'
23+
24+
- name: Restore
25+
run: dotnet restore
26+
27+
- name: Publish Slim binaries (x64/x86)
28+
shell: pwsh
29+
run: |
30+
dotnet publish StickyNote.csproj -c Release -r win-x64 /p:PublishSingleFile=true /p:SelfContained=false -o publish-slim/win-x64
31+
dotnet publish StickyNote.csproj -c Release -r win-x86 /p:PublishSingleFile=true /p:SelfContained=false -o publish-slim/win-x86
32+
33+
- name: Publish Self-contained binaries (x64/x86)
34+
shell: pwsh
35+
run: |
36+
dotnet publish StickyNote.csproj -c Release -r win-x64 /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true -o publish-sc/win-x64
37+
dotnet publish StickyNote.csproj -c Release -r win-x86 /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true -o publish-sc/win-x86
38+
39+
- name: Install Inno Setup
40+
shell: pwsh
41+
run: |
42+
choco install innosetup -y
43+
44+
- name: Compile installers (Slim & Full x64/x86)
45+
shell: pwsh
46+
run: |
47+
$iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe"
48+
& $iscc 'installer\StickyNote_slim.iss' /DArch=x64
49+
& $iscc 'installer\StickyNote_slim.iss' /DArch=x86
50+
& $iscc 'installer\StickyNote_sc.iss' /DArch=x64
51+
& $iscc 'installer\StickyNote_sc.iss' /DArch=x86
52+
53+
- name: Upload installers artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: sticky-note-installers
57+
path: |
58+
installer/out/*.exe
59+
60+
- name: Create GitHub Release
61+
if: startsWith(github.ref, 'refs/tags/')
62+
id: create_release
63+
uses: actions/create-release@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
tag_name: ${{ github.ref_name }}
68+
release_name: StickyNote ${{ github.ref_name }}
69+
draft: false
70+
prerelease: false
71+
72+
- name: Upload asset Slim x64
73+
if: startsWith(github.ref, 'refs/tags/')
74+
uses: actions/upload-release-asset@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
upload_url: ${{ steps.create_release.outputs.upload_url }}
79+
asset_path: installer/out/StickyNote_Setup_Slim_x64.exe
80+
asset_name: StickyNote_Setup_Slim_x64.exe
81+
asset_content_type: application/octet-stream
82+
83+
- name: Upload asset Slim x86
84+
if: startsWith(github.ref, 'refs/tags/')
85+
uses: actions/upload-release-asset@v1
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
with:
89+
upload_url: ${{ steps.create_release.outputs.upload_url }}
90+
asset_path: installer/out/StickyNote_Setup_Slim_x86.exe
91+
asset_name: StickyNote_Setup_Slim_x86.exe
92+
asset_content_type: application/octet-stream
93+
94+
- name: Upload asset Full x64
95+
if: startsWith(github.ref, 'refs/tags/')
96+
uses: actions/upload-release-asset@v1
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
with:
100+
upload_url: ${{ steps.create_release.outputs.upload_url }}
101+
asset_path: installer/out/StickyNote_Setup_x64.exe
102+
asset_name: StickyNote_Setup_x64.exe
103+
asset_content_type: application/octet-stream
104+
105+
- name: Upload asset Full x86
106+
if: startsWith(github.ref, 'refs/tags/')
107+
uses: actions/upload-release-asset@v1
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
with:
111+
upload_url: ${{ steps.create_release.outputs.upload_url }}
112+
asset_path: installer/out/StickyNote_Setup_x86.exe
113+
asset_name: StickyNote_Setup_x86.exe
114+
asset_content_type: application/octet-stream

App.xaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Application x:Class="StickyNote.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
Startup="Application_Startup" Exit="Application_Exit">
5+
<!-- 绑定启动事件 -->
6+
<Application.Resources>
7+
<DrawingImage x:Key="AppIconImage">
8+
<DrawingImage.Drawing>
9+
<DrawingGroup>
10+
<GeometryDrawing Brush="#E8D096">
11+
<GeometryDrawing.Geometry>
12+
<RectangleGeometry Rect="0,0,16,16" />
13+
</GeometryDrawing.Geometry>
14+
</GeometryDrawing>
15+
<GeometryDrawing>
16+
<GeometryDrawing.Pen>
17+
<Pen Brush="#BFA870" Thickness="1" />
18+
</GeometryDrawing.Pen>
19+
<GeometryDrawing.Geometry>
20+
<LineGeometry StartPoint="1,12" EndPoint="15,12" />
21+
</GeometryDrawing.Geometry>
22+
</GeometryDrawing>
23+
<GeometryDrawing Brush="#5D4037">
24+
<GeometryDrawing.Geometry>
25+
<GeometryGroup>
26+
<EllipseGeometry Center="13,3" RadiusX="2" RadiusY="2"/>
27+
<RectangleGeometry Rect="11,3,2,8"/>
28+
</GeometryGroup>
29+
</GeometryDrawing.Geometry>
30+
</GeometryDrawing>
31+
</DrawingGroup>
32+
</DrawingImage.Drawing>
33+
</DrawingImage>
34+
</Application.Resources>
35+
</Application>

0 commit comments

Comments
 (0)