Skip to content

Commit ca0a214

Browse files
committed
some update
chore(CI): fix NSIS missing
1 parent 50995c7 commit ca0a214

File tree

15 files changed

+308
-70
lines changed

15 files changed

+308
-70
lines changed

.github/workflows/build_windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
6363
- name: Install sccache and nsis
6464
run: |
65-
choco install sccache nsis
66-
sccache --start-server
67-
sccache -z
68-
sccache -s
65+
choco install sccache nsis
66+
sccache --start-server
67+
sccache -z
68+
sccache -s
6969
7070
- name: Install latest libmpv
7171
shell: pwsh
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Build and Release
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "8 15 * * 2"
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
10+
RUST_BACKTRACE: full
11+
12+
jobs:
13+
build:
14+
strategy:
15+
matrix:
16+
include:
17+
# x86_64-windows-gnu
18+
- arch: ucrt-x86_64-windows-gnu
19+
os: windows-latest
20+
target: amd64
21+
22+
runs-on: ${{ matrix.os }}
23+
24+
outputs:
25+
latest_tag: ${{ steps.latest_tag.outputs.LA_TAG }}
26+
# latest_rel: ${{ steps.latest_tag.outputs.LA_REL }}
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
repository: tsukinaha/tsukimi
33+
fetch-depth: 0
34+
submodules: true
35+
36+
- name: Get latest tag and check
37+
id: latest_tag
38+
run: |
39+
# $json = Invoke-WebRequest "https://api.github.com/repos/Kosette/tsukimi/releases/latest" | ConvertFrom-Json
40+
# echo "LA_REL=$($json.tag_name)" >> $ENV:GITHUB_OUTPUT
41+
# echo "LA_TAG=$(git describe --tags --abbrev=0)" >> $ENV:GITHUB_OUTPUT
42+
echo "LA_TAG=v0.21.0" >> $ENV:GITHUB_OUTPUT
43+
44+
- name: Setup msys2
45+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
46+
uses: msys2/setup-msys2@v2
47+
with:
48+
update: true
49+
release: false
50+
msystem: UCRT64
51+
install: >-
52+
mingw-w64-ucrt-x86_64-pkgconf
53+
mingw-w64-ucrt-x86_64-gcc
54+
mingw-w64-ucrt-x86_64-libadwaita
55+
mingw-w64-ucrt-x86_64-gstreamer
56+
mingw-w64-ucrt-x86_64-glib2
57+
mingw-w64-ucrt-x86_64-gst-plugins-base
58+
mingw-w64-ucrt-x86_64-gst-plugins-good
59+
mingw-w64-ucrt-x86_64-gst-plugins-bad
60+
mingw-w64-ucrt-x86_64-gst-plugins-ugly
61+
mingw-w64-ucrt-x86_64-gst-libav
62+
curl
63+
git
64+
65+
- name: Install latest libmpv
66+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
67+
shell: pwsh
68+
env:
69+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
run: |
71+
$json = curl -s "https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest" -H "Authorization: Bearer $env:TOKEN" | ConvertFrom-Json
72+
$asset = $json.assets | Where-Object { $_.name -match "mpv-dev-x86_64-\d{8}-git" } | Select-Object -First 1
73+
curl -L -o $asset.name $asset.browser_download_url
74+
7z x -y $asset.name -olibmpv
75+
cp -force libmpv/libmpv.dll.a c:/msys64/ucrt64/lib/
76+
cp -force libmpv/libmpv-2.dll c:/msys64/ucrt64/bin/
77+
cp -force -recurse libmpv/include/mpv c:/msys64/ucrt64/include/
78+
79+
- name: Build tsukimi-${{ matrix.arch }}
80+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
81+
shell: msys2 {0}
82+
run: |
83+
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH"
84+
git reset --hard ${{ steps.latest_tag.outputs.LA_TAG }}
85+
rustup default nightly-gnu
86+
cargo build --release --locked
87+
88+
- name: Prepare Package
89+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
90+
shell: msys2 {0}
91+
run: |
92+
mkdir artifact && cd artifact
93+
mkdir tsukimi-x86_64-windows-gnu/ && cd tsukimi-x86_64-windows-gnu/ && mkdir bin/ && mkdir share/ && mkdir lib/
94+
cp $GITHUB_WORKSPACE/target/release/tsukimi.exe bin/
95+
cp /ucrt64/bin/gdbus.exe bin/
96+
97+
cp -r /ucrt64/lib/gdk-pixbuf-2.0 lib/
98+
find lib/gdk-pixbuf-2.0/2.10.0/loaders -type f ! -name "*.dll" -exec rm -f "{}" \;
99+
100+
cp -r /ucrt64/lib/gio lib/
101+
102+
cp -r /ucrt64/lib/gstreamer-1.0 lib/ && find lib/gstreamer-1.0 -type f ! -name "*.dll" -exec rm -f "{}" \;
103+
104+
cp -r $GITHUB_WORKSPACE/i18n/locale share/
105+
106+
cp -r /ucrt64/share/glib-2.0 share/
107+
find share/glib-2.0/* -maxdepth 0 -type d ! -name "*schemas*" -exec rm -rf "{}" \;
108+
mv $GITHUB_WORKSPACE/resources/moe.tsuna.tsukimi.gschema.xml share/glib-2.0/schemas/
109+
glib-compile-schemas.exe share/glib-2.0/schemas/
110+
find share/glib-2.0/ -type f ! -name "*.compiled" -exec rm -f "{}" \;
111+
112+
cp -r /ucrt64/share/icons share/
113+
cp $GITHUB_WORKSPACE/resources/icons/moe.tsuna.tsukimi.png share/icons/
114+
rm -rf share/icons/hicolor && rm -rf share/icons/AdwaitaLegacy && rm -rf share/icons/Adwaita/scalable && rm -rf share/icons/Adwaita/cursors
115+
rm -rf share/icons/Adwaita/16x16 && rm -rf share/icons/Adwaita/symbolic-up-to-32
116+
117+
find . -type d -empty -delete
118+
119+
cd lib/gstreamer-1.0
120+
rm -f \
121+
libgstadpcmenc.dll libgstamfcodec.dll libgstdvbsubenc.dll libgstencoding.dll \
122+
libgstfrei0r.dll libgstinter.dll libgstlame.dll libgstldac.dll libgstmpeg2enc.dll \
123+
libgstmpegpsmux.dll libgstmpegtsmux.dll libgstmplex.dll libgstrealmedia.dll \
124+
libgstsubenc.dll libgstsvtav1.dll libgstsvthevcenc.dll libgsttwolame.dll \
125+
libgstvoamrwbenc.dll libgstwavenc.dll libgstx264.dll libgstx265.dll \
126+
libgstxingmux.dll libgsty4menc.dll libgstzbar.dll
127+
128+
cd $GITHUB_WORKSPACE/artifact/tsukimi-x86_64-windows-gnu
129+
ldd bin/tsukimi.exe | grep '\/ucrt64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
130+
find lib/ -type f -name "*.dll" -exec ldd "{}" \; | grep '\/ucrt64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
131+
132+
- name: Create NSIS installer
133+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
134+
shell: powershell
135+
run: |
136+
choco install nsis
137+
cp ./installer/* artifact
138+
& 'C:\Program Files (x86)\NSIS\makensis.exe' /V4 artifact/tsukimi_installer.nsi
139+
rm artifact/tsukimi_installer.nsi
140+
141+
- name: Build Package
142+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
143+
shell: powershell
144+
run: |
145+
cd artifact/tsukimi-x86_64-windows-gnu
146+
7z.exe a ../tsukimi-x86_64-windows-gnu.7z ./*
147+
148+
- name: Upload artifact
149+
# if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
150+
uses: actions/upload-artifact@v4
151+
with:
152+
name: tsukimi-${{ matrix.arch }}
153+
path: |
154+
artifact/*.exe
155+
artifact/*.7z
156+
compression-level: 0
157+
retention-days: 3
158+
if-no-files-found: error
159+
160+
publish:
161+
needs: build
162+
runs-on: ubuntu-latest
163+
permissions:
164+
contents: write
165+
166+
steps:
167+
- name: Download artifacts
168+
# if: ${{ needs.build.outputs.latest_tag != needs.build.outputs.latest_rel }}
169+
uses: actions/download-artifact@v4
170+
171+
- name: Calculate hash
172+
# if: ${{ needs.build.outputs.latest_tag != needs.build.outputs.latest_rel }}
173+
run: |
174+
mv tsukimi-ucrt-x86_64-windows-gnu/* .
175+
sha512sum *.7z > tsukimi.sha512sum
176+
sha512sum *.exe >> tsukimi.sha512sum
177+
178+
- name: Upload Github Assets
179+
# if: ${{ needs.build.outputs.latest_tag != needs.build.outputs.latest_rel }}
180+
uses: softprops/action-gh-release@v2
181+
env:
182+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183+
with:
184+
body: |
185+
> [!IMPORTANT]
186+
> This release is for Windows ONLY.
187+
188+
Full-Changelog: https://github.com/tsukinaha/tsukimi/releases/tag/${{ needs.build.outputs.latest_tag }}
189+
files: |
190+
*.7z
191+
*.exe
192+
tsukimi.sha512sum
193+
tag_name: ${{ needs.build.outputs.latest_tag }}

.github/workflows/cargo_clippy_check.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
container:
1111
image: ubuntu:plucky
1212
steps:
13-
1413
- name: Setup Environment
1514
run: |
1615
apt-get update

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/i18n
33
/.idea
44
/backup
5+
/.cargo

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ windows = { version = "0.62.1", features = [
8686
[profile.release]
8787
lto = true
8888
strip = true
89-
debug = "limited"
89+
opt-level = "s"
9090
codegen-units = 1
9191

9292
[profile.dev]

resources/style-dark.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.scroll-spinner {
2-
background-color: rgba(0, 0, 0, 0.5);
2+
background-color: rgba(0, 0, 0, 0.5);
33
}
44

55
.played-mark {
6-
background-color: rgba(0, 0, 0, 0.5);
6+
background-color: rgba(0, 0, 0, 0.5);
77
}

resources/style.css

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ button.pill.ultrasmall {
5353
background: transparent;
5454
}
5555

56-
5756
.bottom-bar {
5857
background: transparent;
5958
}
@@ -92,7 +91,7 @@ button.pill.ultrasmall {
9291
border-radius: 10px;
9392
}
9493

95-
.tu-listview>row {
94+
.tu-listview > row {
9695
margin: 10px;
9796
border-radius: 10px;
9897
}
@@ -107,15 +106,17 @@ button.star:hover {
107106
-gtk-icon-transform: rotate(-72deg);
108107
}
109108

110-
to {}
109+
to {
110+
}
111111
}
112112

113113
@keyframes rotate_unstar {
114114
from {
115115
-gtk-icon-transform: rotate(72deg);
116116
}
117117

118-
to {}
118+
to {
119+
}
119120
}
120121

121122
button.star.interacted.starred image {
@@ -139,13 +140,13 @@ button.star.interacted:not(.starred) image {
139140
border-radius: 10px;
140141
}
141142

142-
.horizontal-listview>row {
143+
.horizontal-listview > row {
143144
margin-left: 9px;
144145
margin-right: 9px;
145146
border-radius: 10px;
146147
}
147148

148-
.vertical-listview>row {
149+
.vertical-listview > row {
149150
margin: 9px;
150151
border-radius: 10px;
151152
}
@@ -162,35 +163,35 @@ gridview {
162163
background-color: transparent;
163164
}
164165

165-
gridview>child box {
166+
gridview > child box {
166167
margin: 0px;
167168
}
168169

169-
overlay>label {
170+
overlay > label {
170171
background-color: #aeb5fa;
171172
border-radius: 50px;
172173
margin: 3px;
173174
}
174175

175-
revealer>box>box>widget {
176+
revealer > box > box > widget {
176177
background-color: rgba(1, 1, 1, 0.1);
177178
border-radius: 10px;
178179
}
179180

180-
revealer>box>box>widget>box {
181+
revealer > box > box > widget > box {
181182
margin: 10px;
182183
}
183184

184-
tabbar>revealer>box {
185+
tabbar > revealer > box {
185186
background-color: transparent;
186187
}
187188

188-
scrolledwindow>viewport>box>box>box {
189+
scrolledwindow > viewport > box > box > box {
189190
margin-left: 15px;
190191
margin-top: 15px;
191192
}
192193

193-
.osd>box {
194+
.osd > box {
194195
margin: 0px;
195196
padding: 0px;
196197
border-radius: 10px;
@@ -231,7 +232,9 @@ row image {
231232

232233
.tulistitempic-button {
233234
opacity: 0;
234-
transition: transform 0.3s ease, opacity 0.3s ease;
235+
transition:
236+
transform 0.3s ease,
237+
opacity 0.3s ease;
235238
transform: translateY(6px);
236239
}
237240

@@ -271,9 +274,11 @@ row image {
271274
}
272275

273276
.themeselector checkbutton.follow {
274-
background-image: linear-gradient(to bottom right,
275-
#fff 49.99%,
276-
#202020 50.01%);
277+
background-image: linear-gradient(
278+
to bottom right,
279+
#fff 49.99%,
280+
#202020 50.01%
281+
);
277282
}
278283

279284
.themeselector checkbutton.light {
@@ -323,11 +328,11 @@ checkbutton.theme-selector radio:checked {
323328
color: rgb(125, 210, 227);
324329
}
325330

326-
.pgb>trough {
331+
.pgb > trough {
327332
min-height: 4px;
328333
}
329334

330-
.mpv-seekbar>trough {
335+
.mpv-seekbar > trough {
331336
min-height: 5px;
332337
}
333338

@@ -353,5 +358,10 @@ checkbutton.theme-selector radio:checked {
353358
}
354359

355360
.played-mark {
356-
background-color: rgba(255, 255, 255, 0.5);
361+
background-color: rgba(255, 255, 255, 0.5);
362+
}
363+
364+
/* Scale UI Font to 125% */
365+
* {
366+
-gtk-dpi: 125;
357367
}

src/app.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ mod imp {
6969
}}",
7070
));
7171

72+
#[cfg(target_os = "windows")]
73+
provider.load_from_string("window {box-shadow: 0px 0px 5px 0px rgba(5, 5, 5, 0.4);}");
74+
7275
gtk::style_context_add_provider_for_display(
7376
&Display::default().expect("Could not connect to a display."),
7477
&provider,

0 commit comments

Comments
 (0)