Skip to content

Commit 014a8f3

Browse files
committed
docs: update documentation and add portable packages for Linux/macOS
- Translate Makefile from French to English - Fix README.md: add author section, update installation options, fix GitHub URLs - Fix CONTRIBUTING.md: remove markdown wrapper, update test structure section - Add CODE_OF_CONDUCT.md (Contributor Covenant 2.1) - Update LICENSE and src/main.rs copyright to 2025-2026 - CI/CD: replace standalone binaries with portable packages (.tar.gz) - Linux and macOS packages now include: binary, LICENSE, README.md, install.sh and uninstall.sh scripts - Remove unused icon.ico
1 parent 774ce26 commit 014a8f3

9 files changed

Lines changed: 475 additions & 174 deletions

File tree

.github/workflows/ci.yml

Lines changed: 256 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,120 @@ jobs:
7373
- name: Build Linux binary
7474
run: |
7575
make build
76-
cp target/release/slashsum slashsum-linux-amd64
76+
77+
- name: Create portable package
78+
run: |
79+
TAG_NAME=${GITHUB_REF#refs/tags/}
80+
81+
# Create package directory
82+
mkdir -p slashsum-linux-amd64-portable
83+
84+
# Copy binary
85+
cp target/release/slashsum slashsum-linux-amd64-portable/
86+
87+
# Copy documentation
88+
cp LICENSE slashsum-linux-amd64-portable/
89+
cp README.md slashsum-linux-amd64-portable/
90+
91+
# Create install script
92+
cat > slashsum-linux-amd64-portable/install.sh << 'EOF'
93+
#!/bin/bash
94+
# Slashsum Installation Script for Linux
95+
96+
set -e
97+
98+
INSTALL_DIR="/usr/local/bin"
99+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
100+
101+
echo "🔍 Slashsum Installer for Linux"
102+
echo "================================"
103+
echo ""
104+
105+
# Check if running with sudo for system-wide install
106+
if [ "$EUID" -ne 0 ]; then
107+
echo "⚠️ Not running as root. Will try to install to $INSTALL_DIR"
108+
echo " If this fails, please run: sudo ./install.sh"
109+
echo ""
110+
fi
111+
112+
# Check if binary exists
113+
if [ ! -f "$SCRIPT_DIR/slashsum" ]; then
114+
echo "❌ Error: slashsum binary not found in $SCRIPT_DIR"
115+
exit 1
116+
fi
117+
118+
# Make binary executable
119+
chmod +x "$SCRIPT_DIR/slashsum"
120+
121+
# Create install directory if needed
122+
if [ ! -d "$INSTALL_DIR" ]; then
123+
echo "📁 Creating $INSTALL_DIR..."
124+
mkdir -p "$INSTALL_DIR"
125+
fi
126+
127+
# Copy binary
128+
echo "📦 Installing slashsum to $INSTALL_DIR..."
129+
cp "$SCRIPT_DIR/slashsum" "$INSTALL_DIR/slashsum"
130+
chmod +x "$INSTALL_DIR/slashsum"
131+
132+
# Verify installation
133+
if command -v slashsum &> /dev/null; then
134+
echo ""
135+
echo "✅ Installation successful!"
136+
echo ""
137+
slashsum --version
138+
echo ""
139+
echo "🚀 You can now use 'slashsum' from anywhere."
140+
echo " Try: slashsum --help"
141+
else
142+
echo ""
143+
echo "⚠️ Binary installed but not in PATH."
144+
echo " Add $INSTALL_DIR to your PATH or run:"
145+
echo " $INSTALL_DIR/slashsum --help"
146+
fi
147+
EOF
148+
chmod +x slashsum-linux-amd64-portable/install.sh
149+
150+
# Create uninstall script
151+
cat > slashsum-linux-amd64-portable/uninstall.sh << 'EOF'
152+
#!/bin/bash
153+
# Slashsum Uninstallation Script for Linux
154+
155+
set -e
156+
157+
INSTALL_DIR="/usr/local/bin"
158+
159+
echo "🗑️ Slashsum Uninstaller for Linux"
160+
echo "=================================="
161+
echo ""
162+
163+
if [ "$EUID" -ne 0 ]; then
164+
echo "⚠️ Not running as root. Will try to uninstall from $INSTALL_DIR"
165+
echo " If this fails, please run: sudo ./uninstall.sh"
166+
echo ""
167+
fi
168+
169+
if [ -f "$INSTALL_DIR/slashsum" ]; then
170+
rm "$INSTALL_DIR/slashsum"
171+
echo "✅ Slashsum has been uninstalled successfully."
172+
else
173+
echo "⚠️ Slashsum is not installed in $INSTALL_DIR"
174+
fi
175+
EOF
176+
chmod +x slashsum-linux-amd64-portable/uninstall.sh
177+
178+
# Create the archive
179+
tar -czvf slashsum-linux-amd64-portable.tar.gz slashsum-linux-amd64-portable/
180+
181+
# Show contents
182+
echo "=== Package contents ==="
183+
tar -tzvf slashsum-linux-amd64-portable.tar.gz
77184
78185
- name: Upload Linux artifact
79186
uses: actions/upload-artifact@v4
80187
with:
81188
name: slashsum-linux
82-
path: slashsum-linux-amd64
189+
path: slashsum-linux-amd64-portable.tar.gz
83190

84191
# Build Windows
85192
build-windows:
@@ -446,13 +553,120 @@ jobs:
446553
- name: Build macOS binary
447554
run: |
448555
make build
449-
cp target/release/slashsum slashsum-darwin-amd64
556+
557+
- name: Create portable package
558+
run: |
559+
TAG_NAME=${GITHUB_REF#refs/tags/}
560+
561+
# Create package directory
562+
mkdir -p slashsum-darwin-amd64-portable
563+
564+
# Copy binary
565+
cp target/release/slashsum slashsum-darwin-amd64-portable/
566+
567+
# Copy documentation
568+
cp LICENSE slashsum-darwin-amd64-portable/
569+
cp README.md slashsum-darwin-amd64-portable/
570+
571+
# Create install script
572+
cat > slashsum-darwin-amd64-portable/install.sh << 'EOF'
573+
#!/bin/bash
574+
# Slashsum Installation Script for macOS
575+
576+
set -e
577+
578+
INSTALL_DIR="/usr/local/bin"
579+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
580+
581+
echo "🔍 Slashsum Installer for macOS"
582+
echo "================================"
583+
echo ""
584+
585+
# Check if running with sudo for system-wide install
586+
if [ "$EUID" -ne 0 ]; then
587+
echo "⚠️ Not running as root. Will try to install to $INSTALL_DIR"
588+
echo " If this fails, please run: sudo ./install.sh"
589+
echo ""
590+
fi
591+
592+
# Check if binary exists
593+
if [ ! -f "$SCRIPT_DIR/slashsum" ]; then
594+
echo "❌ Error: slashsum binary not found in $SCRIPT_DIR"
595+
exit 1
596+
fi
597+
598+
# Make binary executable
599+
chmod +x "$SCRIPT_DIR/slashsum"
600+
601+
# Create install directory if needed
602+
if [ ! -d "$INSTALL_DIR" ]; then
603+
echo "📁 Creating $INSTALL_DIR..."
604+
mkdir -p "$INSTALL_DIR"
605+
fi
606+
607+
# Copy binary
608+
echo "📦 Installing slashsum to $INSTALL_DIR..."
609+
cp "$SCRIPT_DIR/slashsum" "$INSTALL_DIR/slashsum"
610+
chmod +x "$INSTALL_DIR/slashsum"
611+
612+
# Verify installation
613+
if command -v slashsum &> /dev/null; then
614+
echo ""
615+
echo "✅ Installation successful!"
616+
echo ""
617+
slashsum --version
618+
echo ""
619+
echo "🚀 You can now use 'slashsum' from anywhere."
620+
echo " Try: slashsum --help"
621+
else
622+
echo ""
623+
echo "⚠️ Binary installed but not in PATH."
624+
echo " Add $INSTALL_DIR to your PATH or run:"
625+
echo " $INSTALL_DIR/slashsum --help"
626+
fi
627+
EOF
628+
chmod +x slashsum-darwin-amd64-portable/install.sh
629+
630+
# Create uninstall script
631+
cat > slashsum-darwin-amd64-portable/uninstall.sh << 'EOF'
632+
#!/bin/bash
633+
# Slashsum Uninstallation Script for macOS
634+
635+
set -e
636+
637+
INSTALL_DIR="/usr/local/bin"
638+
639+
echo "🗑️ Slashsum Uninstaller for macOS"
640+
echo "=================================="
641+
echo ""
642+
643+
if [ "$EUID" -ne 0 ]; then
644+
echo "⚠️ Not running as root. Will try to uninstall from $INSTALL_DIR"
645+
echo " If this fails, please run: sudo ./uninstall.sh"
646+
echo ""
647+
fi
648+
649+
if [ -f "$INSTALL_DIR/slashsum" ]; then
650+
rm "$INSTALL_DIR/slashsum"
651+
echo "✅ Slashsum has been uninstalled successfully."
652+
else
653+
echo "⚠️ Slashsum is not installed in $INSTALL_DIR"
654+
fi
655+
EOF
656+
chmod +x slashsum-darwin-amd64-portable/uninstall.sh
657+
658+
# Create the archive
659+
tar -czvf slashsum-darwin-amd64-portable.tar.gz slashsum-darwin-amd64-portable/
660+
661+
# Show contents
662+
echo "=== Package contents ==="
663+
tar -tzvf slashsum-darwin-amd64-portable.tar.gz
450664
451665
- name: Upload macOS artifact
452666
uses: actions/upload-artifact@v4
453667
with:
454668
name: slashsum-macos
455-
path: slashsum-darwin-amd64
669+
path: slashsum-darwin-amd64-portable.tar.gz
456670

457671
# Build Snap
458672
build-snap:
@@ -506,9 +720,12 @@ jobs:
506720
TAG_NAME=${GITHUB_REF#refs/tags/}
507721
VERSION=${TAG_NAME#v}
508722
509-
# Créer la structure de répertoires
723+
# Extract binary from portable archive
724+
tar -xzvf slashsum-linux-amd64-portable.tar.gz
725+
726+
# Create target structure
510727
mkdir -p target/release
511-
cp slashsum-linux-amd64 target/release/slashsum
728+
cp slashsum-linux-amd64-portable/slashsum target/release/slashsum
512729
chmod +x target/release/slashsum
513730
514731
cat > nfpm.yaml << EOF
@@ -576,11 +793,11 @@ jobs:
576793
577794
# Copier tous les binaires et packages
578795
echo "=== Copying release files ==="
579-
cp slashsum-linux/slashsum-linux-amd64 release/ 2>/dev/null || true
796+
cp slashsum-linux/slashsum-linux-amd64-portable.tar.gz release/ 2>/dev/null || true
580797
cp slashsum-windows/slashsum-windows-amd64.exe release/ 2>/dev/null || true
581798
cp slashsum-installers/slashsum-setup-user-*.exe release/ 2>/dev/null || echo "No User installer"
582799
cp slashsum-installers/slashsum-setup-admin-*.exe release/ 2>/dev/null || echo "No Admin installer"
583-
cp slashsum-macos/slashsum-darwin-amd64 release/ 2>/dev/null || true
800+
cp slashsum-macos/slashsum-darwin-amd64-portable.tar.gz release/ 2>/dev/null || true
584801
cp slashsum-snap/*.snap release/ 2>/dev/null || true
585802
cp slashsum-deb/*.deb release/ 2>/dev/null || true
586803
@@ -602,10 +819,12 @@ jobs:
602819
603820
### 📦 Downloads
604821
605-
#### Binaries
606-
- **🐧 Linux**: `slashsum-linux-amd64`
607-
- **🪟 Windows**: `slashsum-windows-amd64.exe`
608-
- **🍎 macOS**: `slashsum-darwin-amd64`
822+
#### Portable packages (includes install script, LICENSE, README)
823+
- **🐧 Linux**: `slashsum-linux-amd64-portable.tar.gz`
824+
- **🍎 macOS**: `slashsum-darwin-amd64-portable.tar.gz`
825+
826+
#### Windows
827+
- **Standalone**: `slashsum-windows-amd64.exe`
609828
610829
#### Windows Installers
611830
- **👤 User Installer**: `slashsum-setup-user-${{ github.ref_name }}.exe` (no admin rights required)
@@ -647,16 +866,32 @@ jobs:
647866
slashsum --version
648867
```
649868
650-
#### Manual installation (all platforms)
869+
#### macOS
651870
```bash
652-
# Linux/macOS
653-
chmod +x slashsum-*
654-
sudo mv slashsum-* /usr/local/bin/slashsum
655-
656-
# Windows (PowerShell as admin)
657-
# Create C:\Tools if needed, then:
658-
# Move-Item slashsum-windows-amd64.exe C:\Tools\slashsum.exe
659-
# Add C:\Tools to system PATH
871+
# Download and extract
872+
tar -xzvf slashsum-darwin-amd64-portable.tar.gz
873+
cd slashsum-darwin-amd64-portable
874+
875+
# Run the install script
876+
sudo ./install.sh
877+
878+
# Or manual installation
879+
chmod +x slashsum
880+
sudo mv slashsum /usr/local/bin/
881+
```
882+
883+
#### Linux (Portable)
884+
```bash
885+
# Download and extract
886+
tar -xzvf slashsum-linux-amd64-portable.tar.gz
887+
cd slashsum-linux-amd64-portable
888+
889+
# Run the install script
890+
sudo ./install.sh
891+
892+
# Or manual installation
893+
chmod +x slashsum
894+
sudo mv slashsum /usr/local/bin/
660895
```
661896
662897
### ✨ Features

CODE_OF_CONDUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment:
12+
13+
- Using welcoming and inclusive language
14+
- Being respectful of differing viewpoints and experiences
15+
- Gracefully accepting constructive criticism
16+
- Focusing on what is best for the community
17+
- Showing empathy towards other community members
18+
19+
Examples of unacceptable behavior:
20+
21+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
22+
- Trolling, insulting/derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information without explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies within all project spaces, and also applies when an individual is officially representing the project in public spaces.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer at [NDXDev@gmail.com](mailto:NDXDev@gmail.com).
38+
39+
All complaints will be reviewed and investigated promptly and fairly. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

0 commit comments

Comments
 (0)