Skip to content

Commit b6a5f36

Browse files
committed
init
0 parents  commit b6a5f36

11 files changed

Lines changed: 196 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build and release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '0 1 * * *'
9+
10+
jobs:
11+
build-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Get Version
18+
run: |
19+
./check.sh
20+
echo "tag=$(cat tag)" >> $GITHUB_ENV
21+
22+
- name: Build
23+
if: ${{ env.tag != '0' }}
24+
run: ./build.sh
25+
26+
- name: Release
27+
uses: softprops/action-gh-release@v2
28+
if: ${{ env.tag != '0' }}
29+
with:
30+
tag_name: v${{ env.tag }}
31+
files: |
32+
*.deb
33+
Packages
34+
Release

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2025 wcbing
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
自行打包的 [neovide](https://github.com/neovide/neovide),适用于 Debian 或基于 Debian 的发行版。
2+
3+
Self-packaged [neovide](https://github.com/neovide/neovide), suitable for Debian and Debian-based distros.
4+
5+
6+
## Usage/用法
7+
8+
### 直接下载 .deb 文件
9+
10+
直接从 [Releases](https://github.com/wcbing-build/neovide-debs/releases) 下载 .deb 文件。
11+
12+
### 添加 apt 仓库
13+
14+
```sh
15+
echo "Types: deb
16+
URIs: https://github.com/wcbing-build/neovide-debs/releases/latest/download/
17+
Suites: ./
18+
Trusted: yes" | sudo tee /etc/apt/sources.list.d/neovide.sources
19+
sudo apt update
20+
sudo apt install neovide
21+
```

build.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/sh
2+
3+
PACKAGE="neovide"
4+
REPO="neovide/neovide"
5+
6+
VERSION="$(cat tag)"
7+
8+
ARCH="amd64"
9+
AMD64_FILENAME="neovide-linux-x86_64.tar.gz"
10+
ARM64_FILENAME=""
11+
12+
get_url_by_arch() {
13+
case $1 in
14+
"amd64") echo "https://github.com/$REPO/releases/latest/download/$AMD64_FILENAME" ;;
15+
"arm64") echo "https://github.com/$REPO/releases/latest/download/$ARM64_FILENAME" ;;
16+
esac
17+
}
18+
19+
build() {
20+
# Prepare
21+
BASE_DIR="$PACKAGE"_"$VERSION"-1_"$1"
22+
cp -r templates "$BASE_DIR"
23+
sed -i "s/Architecture: arch/Architecture: $1/" "$BASE_DIR/DEBIAN/control"
24+
sed -i "s/Version: version/Version: $VERSION-1/" "$BASE_DIR/DEBIAN/control"
25+
# Download and move file
26+
curl https://api.github.com/repos/$REPO/releases/latest | jq -r '.body' > $BASE_DIR/usr/share/doc/$PACKAGE/CHANGELOG.md
27+
curl -Lo $BASE_DIR/usr/share/applications/neovide.desktop https://github.com/neovide/neovide/raw/refs/heads/main/assets/neovide.desktop
28+
curl -Lo $BASE_DIR/usr/share/icons/hicolor/256x256/apps/neovide.png https://github.com/neovide/neovide/raw/main/assets/neovide-256x256.png
29+
curl -sLo "$PACKAGE-$VERSION-$1.tar.gz" "$(get_url_by_arch $1)"
30+
tar -xzf "$PACKAGE-$VERSION-$1.tar.gz"
31+
mv "$PACKAGE" "$BASE_DIR/usr/bin/$PACKAGE"
32+
chmod 755 "$BASE_DIR/usr/bin/$PACKAGE"
33+
# Build
34+
dpkg-deb --build --root-owner-group -Z xz "$BASE_DIR"
35+
}
36+
37+
for i in $ARCH; do
38+
echo "Building $i package..."
39+
build "$i"
40+
done
41+
42+
# Create repo files
43+
apt-ftparchive packages . > Packages
44+
apt-ftparchive release . > Release

check.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
REPO="neovide/neovide"
4+
DEBS_REPO="wcbing-build/neovide-debs"
5+
6+
get_github_latest_tag() {
7+
curl -sw "%{redirect_url}" "https://github.com/$1/releases/latest" |
8+
sed -n 's|.*/releases/tag/[^0-9]*\([^_]*\).*|\1|p'
9+
}
10+
11+
DEBS_VERSION=$(get_github_latest_tag "$DEBS_REPO")
12+
if [ -z "$DEBS_VERSION" ]; then
13+
echo "Error: Can't get version tag from $DEBS_REPO."
14+
DEBS_VERSION="0"
15+
fi
16+
17+
VERSION=$(get_github_latest_tag "$REPO")
18+
if [ -z "$VERSION" ]; then
19+
echo "Error: Can't get version tag from $REPO."
20+
echo 0 > tag
21+
exit 1
22+
elif [ "$DEBS_VERSION" = "$VERSION" ]; then
23+
echo "No update."
24+
echo 0 > tag
25+
exit 0
26+
fi
27+
28+
echo "$VERSION" > tag
29+
echo "Update to $VERSION from $DEBS_VERSION."

templates/DEBIAN/control

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Package: neovide
2+
Version: version
3+
Architecture: arch
4+
Maintainer: wcbing <i@wcbing.top>
5+
Section: editors
6+
Priority: optional
7+
Depends: neovim
8+
Homepage: https://github.com/neovide/neovide
9+
Description: This is a simple graphical user interface for Neovim
10+
(an aggressively refactored and updated Vim editor).
11+
Where possible there are some graphical improvements, but functionally
12+
it should act like the terminal UI.
13+
To checkout all the cool features, installation instructions,
14+
configuration settings and much more, head on over to neovide.dev.

templates/usr/bin/neovide

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This file will be replaced.
2+
这个文件将会被替换。
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Exec=neovide %F
4+
Icon=neovide
5+
Name=Neovide
6+
Keywords=Text;Editor;
7+
Categories=Utility;TextEditor;
8+
Comment=No Nonsense Neovim Client in Rust
9+
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This file will be replaced.
2+
这个文件将会被替换。
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: neovide
3+
Source: https://github.com/neovide/neovide/releases
4+
5+
Files: *
6+
Copyright:
7+
Copyright (c) 2020 Keith Simmons
8+
Copyright (c) 2022-2023 Neovide Contributors
9+
License: MIT
10+
11+
Files: DEBIAN/*
12+
Copyright: 2025 wcbing <i@wcbing.top>
13+
License: MIT
14+
15+
License: MIT
16+
Permission is hereby granted, free of charge, to any person obtaining a copy
17+
of this software and associated documentation files (the "Software"), to deal
18+
in the Software without restriction, including without limitation the rights
19+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20+
copies of the Software, and to permit persons to whom the Software is
21+
furnished to do so, subject to the following conditions:
22+
.
23+
The above copyright notice and this permission notice shall be included in
24+
all copies or substantial portions of the Software.
25+
.
26+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32+
THE SOFTWARE.

0 commit comments

Comments
 (0)