Skip to content

Commit 3ce6e62

Browse files
Merge pull request #274 from MordechaiHadad/add/appimage
Add appimage
2 parents 56a396c + 7765f88 commit 3ce6e62

File tree

6 files changed

+162
-11
lines changed

6 files changed

+162
-11
lines changed

.github/workflows/cd.yml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,49 @@ jobs:
5353
with:
5454
command: build
5555
args: --locked --profile optimized ${{ matrix.tls.ARGS }}
56+
- name: Install AppImage tools
57+
if: matrix.os.NAME == 'linux' && matrix.tls.NAME == 'Rustls'
58+
run: |
59+
sudo apt update && sudo apt install -y libfuse2 # Needed by AppImage/linuxdeploy
60+
61+
# Determine the correct architecture for linuxdeploy download
62+
DOWNLOAD_ARCH=${{ matrix.os.ARCH }}
63+
if [[ "${{ matrix.os.ARCH }}" == "arm" ]]; then
64+
DOWNLOAD_ARCH="aarch64"
65+
fi
66+
67+
echo "Downloading linuxdeploy tools for architecture: $DOWNLOAD_ARCH"
68+
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$DOWNLOAD_ARCH.AppImage" -O linuxdeploy
69+
wget -c "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-$DOWNLOAD_ARCH.AppImage" -O linuxdeploy-plugin-appimage
70+
chmod +x linuxdeploy linuxdeploy-plugin-appimage
71+
72+
- name: Prepare AppDir
73+
if: matrix.os.NAME == 'linux' && matrix.tls.NAME == 'Rustls'
74+
run: |
75+
mkdir -p AppDir/usr/bin AppDir/usr/share/icons/hicolor/256x256/apps AppDir/usr/share/applications
76+
cp target/optimized/bob AppDir/usr/bin/
77+
cp resources/bob-icon.png AppDir/usr/share/icons/hicolor/256x256/apps/bob.png
78+
cat <<EOF > AppDir/bob.desktop
79+
[Desktop Entry]
80+
Name=Bob Neovim Manager
81+
Exec=bob
82+
Icon=bob
83+
Type=Application
84+
Categories=Utility;Development;
85+
Comment=A cross-platform Neovim version manager
86+
EOF
87+
cp AppDir/bob.desktop AppDir/usr/share/applications/
88+
89+
# Verify the file exists right before linuxdeploy
90+
ls -l AppDir/usr/bin/bob
91+
92+
export UPD_INFO="gh-releases-zsync|Matsuuu|bob|latest|bob-${{ matrix.os.ARCH }}.AppImage.zsync"
93+
export OUTPUT="bob-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}.AppImage"
94+
95+
# Change --executable path to be relative to CWD
96+
./linuxdeploy --appdir AppDir --executable AppDir/usr/bin/bob --desktop-file AppDir/bob.desktop --icon-file AppDir/usr/share/icons/hicolor/256x256/apps/bob.png --output appimage
97+
98+
5699
- name: Setup Bob build directory
57100
run: |
58101
mkdir build
@@ -65,6 +108,14 @@ jobs:
65108
name: "bob-${{ matrix.os.NAME }}-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}"
66109
path: ${{ matrix.os.PATH }}
67110
if-no-files-found: error
111+
- name: Upload Bob AppImage
112+
if: matrix.os.NAME == 'linux' && matrix.tls.NAME == 'Rustls'
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: "bob-${{ matrix.os.NAME }}-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}-appimage"
116+
path: "bob-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}.AppImage*"
117+
if-no-files-found: error
118+
retention-days: 7
68119

69120
github-release:
70121
needs: [build]
@@ -87,20 +138,28 @@ jobs:
87138
OUTPUT: CHANGELOG.md
88139
- name: Test changelog
89140
run: echo CHANGELOG.md
90-
- name: Zip artifacts
141+
- name: Prepare Release Assets (Zip binaries, keep AppImages separate)
91142
run: |
92143
cd artifacts
93-
for dir in */; do
144+
# Zip directories (binaries)
145+
find . -mindepth 1 -maxdepth 1 -type d -print0 | while IFS= read -r -d $'\0' dir; do
94146
base=$(basename "$dir")
95147
zip -r "${base}.zip" "$dir"
148+
rm -r "$dir" # Remove original directory after zipping
96149
done
150+
# Move AppImages and zsync files out of subdirectories if they exist
151+
find . -mindepth 2 -name '*.AppImage*' -exec mv {} . \;
152+
# Clean up any remaining empty directories from AppImage artifacts
153+
find . -mindepth 1 -maxdepth 1 -type d -empty -delete
154+
echo "Prepared assets:"
155+
ls -l
97156
- name: Release
98157
uses: softprops/action-gh-release@v1
99158
if: startsWith(github.ref, 'refs/tags/')
100159
with:
101160
body_path: CHANGELOG.md
102161
files: |
103-
./artifacts/*.zip
162+
./artifacts/*
104163
105164
publish-cargo:
106165
needs: github-release

.github/workflows/ci.yml

Lines changed: 90 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,48 @@ jobs:
8484
strategy:
8585
matrix:
8686
os:
87-
- { NAME: linux, OS: ubuntu-latest, ARCH: x86_64, PATH: target/optimized/bob, TARGET: "" }
88-
- { NAME: linux, OS: ubuntu-24.04-arm, ARCH: arm, PATH: target/optimized/bob, TARGET: "" }
89-
- { NAME: macos, OS: macos-13, ARCH: x86_64, PATH: target/optimized/bob, TARGET: "" }
90-
- { NAME: windows, OS: windows-latest, ARCH: x86_64, PATH: build, TARGET: "" }
91-
- { NAME: macos, OS: macos-latest, ARCH: arm, PATH: target/optimized/bob, TARGET: "" }
87+
- {
88+
NAME: linux,
89+
OS: ubuntu-latest,
90+
ARCH: x86_64,
91+
PATH: target/optimized/bob,
92+
TARGET: "",
93+
}
94+
- {
95+
NAME: linux,
96+
OS: ubuntu-24.04-arm,
97+
ARCH: arm,
98+
PATH: target/optimized/bob,
99+
TARGET: "",
100+
}
101+
- {
102+
NAME: macos,
103+
OS: macos-13,
104+
ARCH: x86_64,
105+
PATH: target/optimized/bob,
106+
TARGET: "",
107+
}
108+
- {
109+
NAME: windows,
110+
OS: windows-latest,
111+
ARCH: x86_64,
112+
PATH: build,
113+
TARGET: "",
114+
}
115+
- {
116+
NAME: macos,
117+
OS: macos-latest,
118+
ARCH: arm,
119+
PATH: target/optimized/bob,
120+
TARGET: "",
121+
}
92122
tls:
93123
- { NAME: Rustls, SUFFIX: "", ARGS: "" }
94-
- { NAME: OpenSSL, SUFFIX: "-openssl", ARGS: "--no-default-features --features native-tls" }
124+
- {
125+
NAME: OpenSSL,
126+
SUFFIX: "-openssl",
127+
ARGS: "--no-default-features --features native-tls",
128+
}
95129
runs-on: ${{matrix.os.OS}}
96130
steps:
97131
- uses: actions/checkout@v4
@@ -110,6 +144,48 @@ jobs:
110144
with:
111145
command: build
112146
args: --locked --profile optimized ${{ matrix.tls.ARGS }}
147+
- name: Install AppImage tools
148+
if: matrix.os.NAME == 'linux' && matrix.tls.NAME == 'Rustls'
149+
run: |
150+
sudo apt update && sudo apt install -y libfuse2 # Needed by AppImage/linuxdeploy
151+
152+
# Determine the correct architecture for linuxdeploy download
153+
DOWNLOAD_ARCH=${{ matrix.os.ARCH }}
154+
if [[ "${{ matrix.os.ARCH }}" == "arm" ]]; then
155+
DOWNLOAD_ARCH="aarch64"
156+
fi
157+
158+
echo "Downloading linuxdeploy tools for architecture: $DOWNLOAD_ARCH"
159+
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$DOWNLOAD_ARCH.AppImage" -O linuxdeploy
160+
wget -c "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-$DOWNLOAD_ARCH.AppImage" -O linuxdeploy-plugin-appimage
161+
chmod +x linuxdeploy linuxdeploy-plugin-appimage
162+
163+
- name: Prepare AppDir
164+
if: matrix.os.NAME == 'linux' && matrix.tls.NAME == 'Rustls'
165+
run: |
166+
mkdir -p AppDir/usr/bin AppDir/usr/share/icons/hicolor/256x256/apps AppDir/usr/share/applications
167+
cp target/optimized/bob AppDir/usr/bin/
168+
cp resources/bob-icon.png AppDir/usr/share/icons/hicolor/256x256/apps/bob.png
169+
cat <<EOF > AppDir/bob.desktop
170+
[Desktop Entry]
171+
Name=Bob Neovim Manager
172+
Exec=bob
173+
Icon=bob
174+
Type=Application
175+
Categories=Utility;Development;
176+
Comment=A cross-platform Neovim version manager
177+
EOF
178+
cp AppDir/bob.desktop AppDir/usr/share/applications/
179+
180+
# Verify the file exists right before linuxdeploy
181+
ls -l AppDir/usr/bin/bob
182+
183+
export UPD_INFO="gh-releases-zsync|Matsuuu|bob|latest|bob-${{ matrix.os.ARCH }}.AppImage.zsync"
184+
export OUTPUT="bob-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}.AppImage"
185+
186+
# Change --executable path to be relative to CWD
187+
./linuxdeploy --appdir AppDir --executable AppDir/usr/bin/bob --desktop-file AppDir/bob.desktop --icon-file AppDir/usr/share/icons/hicolor/256x256/apps/bob.png --output appimage
188+
113189
- name: Setup Bob build directory
114190
run: |
115191
mkdir build
@@ -123,3 +199,11 @@ jobs:
123199
path: ${{ matrix.os.PATH }}
124200
if-no-files-found: error
125201
retention-days: 7
202+
- name: Upload Bob AppImage
203+
if: matrix.os.NAME == 'linux' && matrix.tls.NAME == 'Rustls'
204+
uses: actions/upload-artifact@v4
205+
with:
206+
name: "bob-${{ matrix.os.NAME }}-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}-appimage"
207+
path: "bob-${{ matrix.os.ARCH }}${{ matrix.tls.SUFFIX }}.AppImage*"
208+
if-no-files-found: error
209+
retention-days: 7

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
<img src="resources/bob-nvim-logo-2-transparent-bg.png" width=315>
3+
<img src="resources/bob.png" width=315>
44

55
</div>
66

@@ -116,6 +116,14 @@ Switch to the specified version, by default will auto-invoke install command if
116116

117117
---
118118

119+
- `bob run |nightly|stable|latest|<version-string>|<commit-hash>| [args...]`
120+
121+
Run a specific installed Neovim version with the provided arguments. `[args...]` are passed directly to the Neovim instance.
122+
123+
Example: `bob run nightly --clean my_file.txt`
124+
125+
---
126+
119127
- `bob install |nightly|stable|latest|<version-string>|<commit-hash>|`
120128

121129
Install the specified version, can also be used to update out-of-date nightly version.

resources/bob-icon.png

14.6 KB
Loading

resources/bob-nvim-logo-2-transparent-bg.png renamed to resources/bob.png

File renamed without changes.

src/helpers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ mod tests {
160160
assert_eq!(super::get_platform_name(&version), "nvim-macos");
161161
assert_eq!(super::get_platform_name_download(&version), "nvim-macos");
162162
} else {
163-
assert_eq!(super::get_platform_name(&version), "nvim");
163+
assert_eq!(super::get_platform_name(&version), "nvim-linux64");
164164
assert_eq!(super::get_platform_name_download(&version), "nvim");
165165
}
166166
}

0 commit comments

Comments
 (0)