Skip to content

Commit 5b29f1e

Browse files
committed
some update
1 parent 8bab636 commit 5b29f1e

File tree

13 files changed

+376
-78
lines changed

13 files changed

+376
-78
lines changed

.github/workflows/build_linux.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
name: Linux CI
22
on:
33
workflow_dispatch:
4-
push:
5-
branches:
6-
- "main"
7-
paths-ignore:
8-
- "docs/**"
9-
- "**/.gitignore"
10-
- "**/.dockerignore"
11-
- LICENSE
12-
- "**/*.md"
13-
pull_request:
14-
branches:
15-
- "main"
16-
paths-ignore:
17-
- "docs/**"
18-
- "**/.gitignore"
19-
- "**/.dockerignore"
20-
- LICENSE
21-
- "**/*.md"
4+
# push:
5+
# branches:
6+
# - "dev"
7+
# paths-ignore:
8+
# - "docs/**"
9+
# - ".gitignore"
10+
# - LICENSE
11+
# - "*.md"
12+
# pull_request:
13+
# branches:
14+
# - "dev"
15+
# paths-ignore:
16+
# - "docs/**"
17+
# - ".gitignore"
18+
# - LICENSE
19+
# - "*.md"
2220

2321
jobs:
2422
build:

.github/workflows/build_release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Publish Release
22
on:
3-
push:
4-
tags:
5-
- v*
3+
workflow_dispatch:
4+
# push:
5+
# tags:
6+
# - v*
67

78
env:
89
CARGO_TERM_COLOR: always

.github/workflows/build_windows.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- "main"
6+
- "dev"
77
paths-ignore:
88
- "docs/**"
9-
- "**/.gitignore"
10-
- "**/.dockerignore"
9+
- ".gitignore"
1110
- LICENSE
12-
- "**/*.md"
13-
pull_request:
14-
branches:
15-
- "main"
16-
paths-ignore:
17-
- "docs/**"
18-
- "**/.gitignore"
19-
- "**/.dockerignore"
20-
- LICENSE
21-
- "**/*.md"
11+
- "*.md"
12+
# pull_request:
13+
# branches:
14+
# - "dev"
15+
# paths-ignore:
16+
# - "docs/**"
17+
# - ".gitignore"
18+
# - LICENSE
19+
# - "*.md"
2220

2321
env:
2422
CARGO_TERM_COLOR: always
@@ -38,7 +36,6 @@ jobs:
3836
# env: x86_64
3937
- arch: ucrt64-x86_64-windows-gnu
4038
os: windows-latest
41-
target: x86_64-pc-windows-gnu
4239
msystem: ucrt64
4340
env: ucrt-x86_64
4441

@@ -74,16 +71,19 @@ jobs:
7471
env:
7572
TOKEN: ${{ secrets.GITHUB_TOKEN }}
7673
run: |
77-
$TOKEN = $env:TOKEN
78-
$json = curl -s "https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest" -H "Authorization: Bearer $TOKEN" | ConvertFrom-Json
79-
$asset = $json.assets | Where-Object { $_.name -match "mpv-dev-x86_64-\d{8}-git" } | Select-Object -First 1
80-
curl -L -o $asset.name $asset.browser_download_url
81-
7z x -y $asset.name -olibmpv
82-
cp -force libmpv/libmpv.dll.a c:/msys64/${{ matrix.msystem }}/lib/
83-
cp -force libmpv/libmpv-2.dll c:/msys64/${{ matrix.msystem }}/bin/
84-
cp -force -recurse libmpv/include/mpv c:/msys64/${{ matrix.msystem }}/include/
85-
86-
- name: Build tsukimi-${{ matrix.target }}
74+
$headers = @{ "Authorization"="Bearer $env:TOKEN" }
75+
$api_gh = "https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest"
76+
$json = Invoke-WebRequest $api_gh -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing -Headers $headers | ConvertFrom-Json
77+
$filename = $json.assets | where { $_.name -Match "mpv-dev-x86_64-v3" } | Select-Object -ExpandProperty name
78+
$download_link = $json.assets | where { $_.name -Match "mpv-dev-x86_64-v3" } | Select-Object -ExpandProperty browser_download_url
79+
Write-Host "Downloading" $filename -ForegroundColor Green
80+
Invoke-WebRequest -Uri $download_link -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::FireFox) -OutFile $filename
81+
7z.exe x $filename -olibmpv
82+
cp -force libmpv/libmpv.dll.a c:/msys64/${{ matrix.msystem }}/lib
83+
cp -force libmpv/libmpv-2.dll c:/msys64/${{ matrix.msystem }}/bin
84+
cp -force -recurse libmpv/include/mpv c:/msys64/${{ matrix.msystem }}/include
85+
86+
- name: Build tsukimi-${{ matrix.arch }}
8787
shell: msys2 {0}
8888
run: |
8989
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH"
@@ -156,11 +156,12 @@ jobs:
156156
- name: Upload artifact
157157
uses: actions/upload-artifact@v4
158158
with:
159-
name: tsukimi-${{matrix.target}}
159+
name: tsukimi-${{matrix.arch}}
160160
path: |
161-
artifact/*.exe
162161
artifact/*.7z
162+
artifact/*.exe
163163
artifact/*.sha512sum
164164
compression-level: 0
165165
retention-days: 3
166-
if-no-files-found: error
166+
if-no-files-found: error
167+
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+
# push:
5+
# branches: ["release"]
6+
schedule:
7+
- cron: "8 15 * * *"
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
12+
RUST_BACKTRACE: full
13+
14+
jobs:
15+
build:
16+
strategy:
17+
matrix:
18+
include:
19+
# x86_64-windows-gnu
20+
- arch: ucrt-x86_64-windows-gnu
21+
os: windows-latest
22+
target: amd64
23+
24+
runs-on: ${{ matrix.os }}
25+
26+
outputs:
27+
latest_tag: ${{ steps.latest_tag.outputs.LA_TAG }}
28+
latest_rel: ${{ steps.latest_tag.outputs.LA_REL }}
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
repository: tsukinaha/tsukimi
35+
fetch-depth: 0
36+
submodules: true
37+
38+
- name: Get latest tag and check
39+
id: latest_tag
40+
run: |
41+
$json = Invoke-WebRequest "https://api.github.com/repos/Kosette/tsukimi/releases/latest" | ConvertFrom-Json
42+
echo "LA_REL=$($json.tag_name)" >> $ENV:GITHUB_OUTPUT
43+
echo "LA_TAG=$(git describe --tags --abbrev=0)" >> $ENV:GITHUB_OUTPUT
44+
45+
- name: Setup msys2
46+
if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
47+
uses: msys2/setup-msys2@v2
48+
with:
49+
update: true
50+
release: false
51+
msystem: UCRT64
52+
install: >-
53+
mingw-w64-ucrt-x86_64-pkgconf
54+
mingw-w64-ucrt-x86_64-gcc
55+
mingw-w64-ucrt-x86_64-libadwaita
56+
mingw-w64-ucrt-x86_64-gstreamer
57+
mingw-w64-ucrt-x86_64-glib2
58+
mingw-w64-ucrt-x86_64-gst-plugins-base
59+
mingw-w64-ucrt-x86_64-gst-plugins-good
60+
mingw-w64-ucrt-x86_64-gst-plugins-bad
61+
mingw-w64-ucrt-x86_64-gst-plugins-ugly
62+
mingw-w64-ucrt-x86_64-gst-libav
63+
curl
64+
git
65+
66+
- name: Install latest libmpv
67+
if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
68+
shell: pwsh
69+
env:
70+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: |
72+
$json = curl -s "https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest" -H "Authorization: Bearer $env:TOKEN" | ConvertFrom-Json
73+
$asset = $json.assets | Where-Object { $_.name -match "mpv-dev-x86_64-\d{8}-git" } | Select-Object -First 1
74+
curl -L -o $asset.name $asset.browser_download_url
75+
7z x -y $asset.name -olibmpv
76+
cp -force libmpv/libmpv.dll.a c:/msys64/ucrt64/lib/
77+
cp -force libmpv/libmpv-2.dll c:/msys64/ucrt64/bin/
78+
cp -force -recurse libmpv/include/mpv c:/msys64/ucrt64/include/
79+
80+
- name: Build tsukimi-${{ matrix.arch }}
81+
if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
82+
shell: msys2 {0}
83+
run: |
84+
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH"
85+
git reset --hard ${{ steps.latest_tag.outputs.LA_TAG }}
86+
rustup default stable-gnu
87+
cargo build --release --locked
88+
89+
- name: Prepare Package
90+
if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
91+
shell: msys2 {0}
92+
run: |
93+
mkdir artifact && cd artifact
94+
mkdir tsukimi-x86_64-windows-gnu/ && cd tsukimi-x86_64-windows-gnu/ && mkdir bin/ && mkdir share/ && mkdir lib/
95+
cp $GITHUB_WORKSPACE/target/release/tsukimi.exe bin/
96+
cp /ucrt64/bin/gdbus.exe bin/
97+
98+
cp -r /ucrt64/lib/gdk-pixbuf-2.0 lib/
99+
find lib/gdk-pixbuf-2.0/2.10.0/loaders -type f ! -name "*.dll" -exec rm -f "{}" \;
100+
101+
cp -r /ucrt64/lib/gio lib/
102+
103+
cp -r /ucrt64/lib/gstreamer-1.0 lib/ && find lib/gstreamer-1.0 -type f ! -name "*.dll" -exec rm -f "{}" \;
104+
105+
cp -r $GITHUB_WORKSPACE/i18n/locale share/
106+
107+
cp -r /ucrt64/share/glib-2.0 share/
108+
find share/glib-2.0/* -maxdepth 0 -type d ! -name "*schemas*" -exec rm -rf "{}" \;
109+
mv $GITHUB_WORKSPACE/resources/moe.tsuna.tsukimi.gschema.xml share/glib-2.0/schemas/
110+
glib-compile-schemas.exe share/glib-2.0/schemas/
111+
find share/glib-2.0/ -type f ! -name "*.compiled" -exec rm -f "{}" \;
112+
113+
cp -r /ucrt64/share/icons share/
114+
cp $GITHUB_WORKSPACE/resources/icons/moe.tsuna.tsukimi.png share/icons/
115+
rm -rf share/icons/hicolor && rm -rf share/icons/AdwaitaLegacy && rm -rf share/icons/Adwaita/scalable && rm -rf share/icons/Adwaita/cursors
116+
rm -rf share/icons/Adwaita/16x16 && rm -rf share/icons/Adwaita/symbolic-up-to-32
117+
118+
find . -type d -empty -delete
119+
120+
cd lib/gstreamer-1.0
121+
rm -f \
122+
libgstadpcmenc.dll libgstamfcodec.dll libgstdvbsubenc.dll libgstencoding.dll \
123+
libgstfrei0r.dll libgstinter.dll libgstlame.dll libgstldac.dll libgstmpeg2enc.dll \
124+
libgstmpegpsmux.dll libgstmpegtsmux.dll libgstmplex.dll libgstrealmedia.dll \
125+
libgstsubenc.dll libgstsvtav1.dll libgstsvthevcenc.dll libgsttwolame.dll \
126+
libgstvoamrwbenc.dll libgstwavenc.dll libgstx264.dll libgstx265.dll \
127+
libgstxingmux.dll libgsty4menc.dll libgstzbar.dll
128+
129+
cd $GITHUB_WORKSPACE/artifact/tsukimi-x86_64-windows-gnu
130+
ldd bin/tsukimi.exe | grep '\/ucrt64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
131+
find lib/ -type f -name "*.dll" -exec ldd "{}" \; | grep '\/ucrt64.*\.dll' -o | xargs -I{} cp -n "{}" bin/
132+
133+
- name: Create NSIS installer
134+
if: ${{ steps.latest_tag.outputs.LA_REL != steps.latest_tag.outputs.LA_TAG }}
135+
shell: powershell
136+
run: |
137+
cp ./installer/* artifact
138+
makensis /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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
1717
- name: Run Clippy
1818
run: |
19-
docker run --rm -v ${{ github.workspace }}:/app -v ./entrypoint.sh:/entrypoint.sh ghcr.io/tsukinaha/ubuntu-rust-gtk4:latest
19+
docker run --rm -v ${{ github.workspace }}:/app -v ./entrypoint.sh:/entrypoint.sh ghcr.io/kosette/ubuntu-rust-gtk4:latest

.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.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ reqwest = { version = "0.12", default-features = false, features = [
2121
] }
2222
once_cell = "1.21.1"
2323
dirs = "6.0.0"
24-
adw = { version = "0.7", package = "libadwaita", features = ["v1_6"] }
24+
adw = { version = "=0.7.1", package = "libadwaita", features = ["v1_6"] }
2525
bytefmt = "0.1.7"
2626
libc = "0.2.171"
2727
uuid = { version = "1.16.0", features = ["v4"] }
2828
chrono = { version = "0.4.40", features = ["serde"] }
2929
tracing = "0.1.41"
3030
gst = { version = "0.23", package = "gstreamer" }
3131
url = "2.5.4"
32-
image = "0.25.5"
32+
image = "0.25.6"
3333
gettext-rs = { version = "~0.7", features = ["gettext-system"] }
3434
hostname = "0.4.0"
3535
epoxy = "0.1.0"
@@ -81,8 +81,8 @@ windows = { version = "0.61.1", features = [
8181
[profile.release]
8282
lto = "thin"
8383
strip = true
84-
debug = "limited"
8584
codegen-units = 1
85+
opt-level = "s"
8686

8787
[profile.dev]
8888
debug = true

resources/style-dark.css

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

0 commit comments

Comments
 (0)