Skip to content

Commit 8a999d8

Browse files
authored
Merge pull request #6 from sireliah/windows-icon
Build icon on Windows
2 parents e14c0b4 + be1e9b7 commit 8a999d8

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
runs-on: windows-latest
8989
needs: build-linux
9090
env:
91-
gvsbuildref: 69cdac34c36d74eeae37006bb0fcedc64ee518dd
91+
gvsbuildref: 3d3067d1090df7bfdf4b29680b951024e37b20ae
9292
gvsbuildupdate: 1
9393

9494
outputs:
@@ -158,11 +158,29 @@ jobs:
158158

159159
- uses: actions/checkout@v2
160160

161+
- name: Compile icon resource
162+
run: |
163+
# TODO: how to call the rc without copying it?
164+
cp $env:RC_BIN\rc.exe src\
165+
cp $env:RC_BIN\rcdll.dll src\
166+
cd src
167+
.\rc.exe dragit.rc
168+
ls
169+
env:
170+
RC_BIN: C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64/
171+
161172
- uses: actions-rs/toolchain@v1
162173
with:
163174
toolchain: stable
164175
default: true
165176

177+
- name: Create linker config for the icon
178+
run: |
179+
$repoPath = $env:GITHUB_WORKSPACE -replace "\\", "/"
180+
mkdir .cargo
181+
Set-Content -Path .\.cargo\config -Value "[build]`nrustflags = [`"-Clink-args=${repoPath}/src/dragit.res`"]"
182+
Get-Content .\.cargo\config
183+
166184
- name: Build release
167185
uses: actions-rs/cargo@v1
168186
with:
@@ -193,8 +211,7 @@ jobs:
193211
cp -r C:\gtk-build\gtk\x64\release\share\glib-2.0 $env:PACKAGE_DIR\share\
194212
195213
# Icons are installed from msys2.
196-
# TODO: Figure out the env var for the temp path
197-
cp -r D:\a\_temp\msys\msys64\mingw64\share\icons $env:PACKAGE_DIR\share\
214+
cp -r $env:RUNNER_TEMP\msys\msys64\mingw64\share\icons $env:PACKAGE_DIR\share\
198215
199216
# https://github.com/gtk-rs/gtk/issues/422
200217
cp -r C:\gtk-build\gtk\x64\release\lib\gdk-pixbuf-2.0 $env:PACKAGE_DIR\lib\

src/dragit.rc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
id ICON "../static/logo_icon_t.ico"
2+
1 VERSIONINFO
3+
FILEVERSION 1,0,0,0
4+
PRODUCTVERSION 1,0,0,0
5+
BEGIN
6+
BLOCK "StringFileInfo"
7+
BEGIN
8+
BLOCK "040904E4"
9+
BEGIN
10+
VALUE "CompanyName", "Open-Source"
11+
VALUE "FileDescription", "Dragit, intuitive file sharing"
12+
VALUE "FileVersion", "1.0"
13+
VALUE "InternalName", "dragit"
14+
VALUE "LegalCopyright", "sireliah"
15+
VALUE "OriginalFilename", "dragit.exe"
16+
VALUE "ProductName", "Dragit"
17+
VALUE "ProductVersion", "1.0"
18+
END
19+
END
20+
BLOCK "VarFileInfo"
21+
BEGIN
22+
VALUE "Translation", 0x409, 1252
23+
END
24+
END

static/logo_icon_t.ico

264 KB
Binary file not shown.

0 commit comments

Comments
 (0)