0.4.7 #88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Installers | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
PROJECT_NAME: digstore | |
PROJECT_DESC: "Content-addressable storage system with Git-like semantics" | |
PROJECT_AUTH: "DIG Network" | |
PROJECT_HOMEPAGE: "https://github.com/${{ github.repository }}" | |
jobs: | |
build-windows-installer: | |
name: Build Windows Installer | |
runs-on: windows-latest | |
if: github.event_name == 'push' && contains(github.event.head_commit.message, '.') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate version consistency | |
run: | | |
# Extract version from commit message (e.g., "Release 1.2.3" -> "1.2.3") | |
$COMMIT_MSG = "${{ github.event.head_commit.message }}" | |
$COMMIT_VERSION = [regex]::Match($COMMIT_MSG, '[0-9]+\.[0-9]+\.[0-9]+').Value | |
Write-Host "Version in commit message: $COMMIT_VERSION" | |
if ([string]::IsNullOrEmpty($COMMIT_VERSION)) { | |
Write-Host "No version found in commit message, skipping" | |
exit 1 | |
} | |
# Check that Cargo.toml version matches commit message | |
$CARGO_VERSION = (Select-String -Path "Cargo.toml" -Pattern '^version = "([^"]+)"').Matches[0].Groups[1].Value | |
Write-Host "Version in Cargo.toml: $CARGO_VERSION" | |
if ($CARGO_VERSION -ne $COMMIT_VERSION) { | |
Write-Host "ERROR: Version mismatch!" | |
Write-Host " Commit message version: $COMMIT_VERSION" | |
Write-Host " Cargo.toml version: $CARGO_VERSION" | |
Write-Host "Please update Cargo.toml version to match commit message before releasing." | |
exit 1 | |
} | |
Write-Host "✓ Version consistency validated: $COMMIT_VERSION" | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build Release Binary | |
run: | | |
# The build.rs script will create digstore.rc and embed the icon | |
cargo build --release | |
# Verify the icon was embedded | |
Write-Host "Checking if icon was embedded..." | |
$exe = Get-Item "target\release\digstore.exe" | |
$versionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($exe.FullName) | |
Write-Host "ProductName: $($versionInfo.ProductName)" | |
Write-Host "CompanyName: $($versionInfo.CompanyName)" | |
Write-Host "FileDescription: $($versionInfo.FileDescription)" | |
# Clean up temporary RC file created by build script | |
if (Test-Path "digstore.rc") { | |
Remove-Item "digstore.rc" | |
Write-Host "Cleaned up temporary digstore.rc file" | |
} | |
- name: Copy Icon File | |
run: | | |
if (Test-Path "DIG.ico") { | |
Write-Host "Icon file found in repository" | |
$iconInfo = Get-Item "DIG.ico" | |
Write-Host "Icon size: $($iconInfo.Length) bytes" | |
# Icon is already in the right place, no need to copy | |
} else { | |
Write-Host "Warning: DIG.ico not found" -ForegroundColor Yellow | |
} | |
- name: Install WiX Toolset | |
run: | | |
# Download and install WiX v3.11.2 | |
curl -L https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip -o wix.zip | |
Expand-Archive -Path wix.zip -DestinationPath C:\wix | |
echo "C:\wix" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Create Windows Installer | |
run: | | |
mkdir -p installer\windows | |
# Create WiX source file | |
@" | |
<?xml version="1.0" encoding="UTF-8"?> | |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
<Product Id="*" Name="Digstore Min" Language="1033" Version="0.1.0" Manufacturer="$env:PROJECT_AUTH" UpgradeCode="A3F5C8D9-E2B1-F4A6-C9D8-E7F2A5B8C1D4"> | |
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" | |
Description="DIG DataStore - Content-addressable storage system with Git-like semantics. After installation, restart your terminal to use 'digstore' from the command line." /> | |
<MajorUpgrade AllowSameVersionUpgrades="yes" AllowDowngrades="no" | |
DowngradeErrorMessage="A newer version of [ProductName] is already installed." | |
Schedule="afterInstallInitialize" /> | |
<MediaTemplate EmbedCab="yes" /> | |
<!-- Add UI --> | |
<UIRef Id="WixUI_FeatureTree" /> | |
<UIRef Id="WixUI_ErrorProgressText" /> | |
<!-- Custom UI to skip license dialog --> | |
<UI> | |
<!-- Skip license dialog since we don't have a license file --> | |
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="2">1</Publish> | |
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish> | |
</UI> | |
<!-- Custom completion message --> | |
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Digstore has been successfully installed. If you selected 'Add to PATH', please restart your terminal or log out and back in for PATH changes to take effect." /> | |
<!-- Remove custom action as it's causing ICE77 error --> | |
<!-- File associations will be refreshed on next login --> | |
<Feature Id="ProductFeature" Title="Digstore Min" Level="1" Display="expand" ConfigurableDirectory="INSTALLFOLDER"> | |
<ComponentGroupRef Id="ProductComponents" /> | |
<ComponentRef Id="ProgramMenuDir" /> | |
<ComponentRef Id="FileAssociation" /> | |
<!-- Separate feature for PATH addition - optional but default enabled --> | |
<Feature Id="PathFeature" Title="Add to PATH" Description="Add Digstore to system PATH environment variable" Level="1" Display="expand"> | |
<ComponentRef Id="Path" /> | |
</Feature> | |
</Feature> | |
<Directory Id="TARGETDIR" Name="SourceDir"> | |
<Directory Id="ProgramFilesFolder"> | |
<Directory Id="INSTALLFOLDER" Name="dig-network" /> | |
</Directory> | |
<Directory Id="ProgramMenuFolder" Name="Programs"> | |
<Directory Id="ProgramMenuDir" Name="Digstore Min" /> | |
</Directory> | |
</Directory> | |
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | |
<Component Id="MainExecutable"> | |
<File Id="digstore.exe" Source="..\..\target\release\digstore.exe" KeyPath="yes"> | |
<Shortcut Id="startmenuDigstore" Directory="ProgramMenuDir" Name="Digstore Min" | |
WorkingDirectory="INSTALLFOLDER" Icon="digstore.exe" IconIndex="0" Advertise="yes" /> | |
</File> | |
</Component> | |
<Component Id="IconFile"> | |
<File Id="DIG.ico" Source="..\..\DIG.ico" KeyPath="yes" /> | |
</Component> | |
</ComponentGroup> | |
<DirectoryRef Id="TARGETDIR"> | |
<Component Id="Path" Guid="B3F5C8D9-E2B1-F4A6-C9D8-E7F2A5B8C1D5"> | |
<Environment Id="UpdatePath" Name="PATH" Value="[INSTALLFOLDER]" Permanent="no" Part="last" Action="set" System="yes" /> | |
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="PathComponent" Type="integer" Value="1" KeyPath="yes" /> | |
</Component> | |
</DirectoryRef> | |
<Component Id="ProgramMenuDir" Guid="C3F5C8D9-E2B1-F4A6-C9D8-E7F2A5B8C1D6" Directory="ProgramMenuDir"> | |
<RemoveFolder Id="ProgramMenuDir" On="uninstall" /> | |
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes" /> | |
</Component> | |
<Icon Id="digstore.exe" SourceFile="..\..\target\release\digstore.exe" /> | |
<Icon Id="digstore.ico" SourceFile="..\..\DIG.ico" /> | |
<!-- File Association for .dig files --> | |
<DirectoryRef Id="INSTALLFOLDER"> | |
<Component Id="FileAssociation" Guid="D3F5C8D9-E2B1-F4A6-C9D8-E7F2A5B8C1D7"> | |
<RegistryValue Root="HKCR" Key=".dig" Type="string" Value="Digstore.DigFile" KeyPath="yes" /> | |
<RegistryValue Root="HKCR" Key=".dig" Name="Content Type" Type="string" Value="application/x-dig" /> | |
<RegistryValue Root="HKCR" Key="Digstore.DigFile" Type="string" Value="DIG DataStore" /> | |
<RegistryValue Root="HKCR" Key="Digstore.DigFile\DefaultIcon" Type="string" Value="[INSTALLFOLDER]DIG.ico" /> | |
<RegistryValue Root="HKCR" Key="Digstore.DigFile\shell" Type="string" Value="open" /> | |
<RegistryValue Root="HKCR" Key="Digstore.DigFile\shell\open" Type="string" Value="&Open" /> | |
<RegistryValue Root="HKCR" Key="Digstore.DigFile\shell\open\command" Type="string" Value=""[INSTALLFOLDER]digstore.exe" "%1"" /> | |
</Component> | |
</DirectoryRef> | |
<!-- Set the icon for Add/Remove Programs --> | |
<Property Id="ARPPRODUCTICON" Value="digstore.ico" /> | |
</Product> | |
</Wix> | |
"@ | Out-File -FilePath installer\windows\digstore.wxs -Encoding utf8 | |
# Build MSI installer | |
cd installer\windows | |
candle -ext WixUIExtension digstore.wxs | |
light -ext WixUIExtension -ext WixUtilExtension digstore.wixobj -o digstore-windows-x64.msi | |
- name: Upload Windows Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: digstore-windows-installer | |
path: installer/windows/digstore-windows-x64.msi | |
retention-days: 30 | |
build-macos-installer: | |
name: Build macOS Installer | |
runs-on: macos-latest | |
if: github.event_name == 'push' && contains(github.event.head_commit.message, '.') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate version consistency | |
run: | | |
# Extract version from commit message (e.g., "Release 1.2.3" -> "1.2.3") | |
COMMIT_MSG="${{ github.event.head_commit.message }}" | |
COMMIT_VERSION=$(echo "$COMMIT_MSG" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) | |
echo "Version in commit message: $COMMIT_VERSION" | |
if [ -z "$COMMIT_VERSION" ]; then | |
echo "No version found in commit message, skipping" | |
exit 1 | |
fi | |
# Check that Cargo.toml version matches commit message | |
CARGO_VERSION=$(grep '^version = ' Cargo.toml | head -1 | cut -d '"' -f 2) | |
echo "Version in Cargo.toml: $CARGO_VERSION" | |
if [ "$CARGO_VERSION" != "$COMMIT_VERSION" ]; then | |
echo "ERROR: Version mismatch!" | |
echo " Commit message version: $COMMIT_VERSION" | |
echo " Cargo.toml version: $CARGO_VERSION" | |
echo "Please update Cargo.toml version to match commit message before releasing." | |
exit 1 | |
fi | |
echo "✓ Version consistency validated: $COMMIT_VERSION" | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build Universal Binary | |
run: | | |
# Add both targets for cross-compilation | |
rustup target add x86_64-apple-darwin | |
rustup target add aarch64-apple-darwin | |
# Build for both architectures | |
cargo build --release --target x86_64-apple-darwin | |
cargo build --release --target aarch64-apple-darwin | |
# Create universal binary | |
mkdir -p target/release | |
lipo -create -output target/release/digstore \ | |
target/x86_64-apple-darwin/release/digstore \ | |
target/aarch64-apple-darwin/release/digstore | |
- name: Create macOS App Bundle | |
run: | | |
mkdir -p installer/macos | |
APP_NAME="DIG Network Digstore.app" | |
APP_DIR="installer/macos/$APP_NAME" | |
# Create app bundle structure | |
mkdir -p "$APP_DIR/Contents/MacOS" | |
mkdir -p "$APP_DIR/Contents/Resources" | |
# Copy binary | |
cp target/release/digstore "$APP_DIR/Contents/MacOS/" | |
chmod +x "$APP_DIR/Contents/MacOS/digstore" | |
# Create Info.plist | |
cat > "$APP_DIR/Contents/Info.plist" << EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleExecutable</key> | |
<string>digstore</string> | |
<key>CFBundleIdentifier</key> | |
<string>com.digstore.min</string> | |
<key>CFBundleName</key> | |
<string>Digstore Min</string> | |
<key>CFBundlePackageType</key> | |
<string>APPL</string> | |
<key>CFBundleShortVersionString</key> | |
<string>0.1.0</string> | |
<key>LSMinimumSystemVersion</key> | |
<string>10.12</string> | |
<key>NSHighResolutionCapable</key> | |
<true/> | |
</dict> | |
</plist> | |
EOF | |
- name: Create DMG Installer | |
run: | | |
cd installer/macos | |
# Create a temporary disk image | |
hdiutil create -volname "DIG Network Digstore" -srcfolder "DIG Network Digstore.app" -ov -format UDZO digstore-macos.dmg | |
- name: Upload macOS Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: digstore-macos-installer | |
path: installer/macos/digstore-macos.dmg | |
retention-days: 30 | |
build-linux-packages: | |
name: Build Linux Packages | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && contains(github.event.head_commit.message, '.') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate version consistency | |
run: | | |
# Extract version from commit message (e.g., "Release 1.2.3" -> "1.2.3") | |
COMMIT_MSG="${{ github.event.head_commit.message }}" | |
COMMIT_VERSION=$(echo "$COMMIT_MSG" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) | |
echo "Version in commit message: $COMMIT_VERSION" | |
if [ -z "$COMMIT_VERSION" ]; then | |
echo "No version found in commit message, skipping" | |
exit 1 | |
fi | |
# Check that Cargo.toml version matches commit message | |
CARGO_VERSION=$(grep '^version = ' Cargo.toml | head -1 | cut -d '"' -f 2) | |
echo "Version in Cargo.toml: $CARGO_VERSION" | |
if [ "$CARGO_VERSION" != "$COMMIT_VERSION" ]; then | |
echo "ERROR: Version mismatch!" | |
echo " Commit message version: $COMMIT_VERSION" | |
echo " Cargo.toml version: $CARGO_VERSION" | |
echo "Please update Cargo.toml version to match commit message before releasing." | |
exit 1 | |
fi | |
echo "✓ Version consistency validated: $COMMIT_VERSION" | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Packaging Tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y dpkg-dev rpm ruby ruby-dev rubygems build-essential | |
sudo gem install --no-document fpm | |
- name: Build Release Binary | |
run: cargo build --release | |
- name: Create DEB Package | |
run: | | |
mkdir -p installer/linux/deb | |
# Create directory structure | |
mkdir -p installer/linux/deb/usr/bin | |
mkdir -p installer/linux/deb/usr/share/man/man1 | |
mkdir -p installer/linux/deb/usr/share/bash-completion/completions | |
# Copy binary | |
cp target/release/digstore installer/linux/deb/usr/bin/ | |
chmod 755 installer/linux/deb/usr/bin/digstore | |
# Generate man page | |
help2man target/release/digstore > installer/linux/deb/usr/share/man/man1/digstore.1 || true | |
# Generate completion | |
target/release/digstore completion bash > installer/linux/deb/usr/share/bash-completion/completions/digstore || true | |
# Create DEB package using fpm | |
fpm -s dir -t deb \ | |
--name digstore \ | |
--version 0.1.0 \ | |
--architecture amd64 \ | |
--depends "libc6 (>= 2.17)" \ | |
--maintainer "${{ env.PROJECT_AUTH }}" \ | |
--description "${{ env.PROJECT_DESC }}" \ | |
--url "${{ env.PROJECT_HOMEPAGE }}" \ | |
--license "MIT OR Apache-2.0" \ | |
-C installer/linux/deb \ | |
-p installer/linux/digstore_0.1.0_amd64.deb \ | |
usr | |
- name: Create RPM Package | |
run: | | |
# Create RPM package using fpm | |
fpm -s dir -t rpm \ | |
--name digstore \ | |
--version 0.1.0 \ | |
--architecture x86_64 \ | |
--depends "glibc >= 2.17" \ | |
--maintainer "${{ env.PROJECT_AUTH }}" \ | |
--description "${{ env.PROJECT_DESC }}" \ | |
--url "${{ env.PROJECT_HOMEPAGE }}" \ | |
--license "MIT OR Apache-2.0" \ | |
-C installer/linux/deb \ | |
-p installer/linux/digstore-0.1.0-1.x86_64.rpm \ | |
usr | |
- name: Create AppImage | |
run: | | |
# Download AppImage tools | |
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
chmod +x linuxdeploy-x86_64.AppImage | |
# Create AppDir structure | |
mkdir -p installer/linux/AppDir/usr/bin | |
cp target/release/digstore installer/linux/AppDir/usr/bin/ | |
# Create desktop file | |
mkdir -p installer/linux/AppDir/usr/share/applications | |
cat > installer/linux/AppDir/usr/share/applications/digstore.desktop << EOF | |
[Desktop Entry] | |
Type=Application | |
Name=Digstore Min | |
Exec=digstore | |
Icon=digstore | |
Categories=Development;Utility; | |
Terminal=true | |
EOF | |
# Create a simple icon (1x1 PNG as placeholder) | |
mkdir -p installer/linux/AppDir/usr/share/icons/hicolor/256x256/apps | |
echo "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==" | base64 -d > installer/linux/AppDir/usr/share/icons/hicolor/256x256/apps/digstore.png | |
# Build AppImage | |
./linuxdeploy-x86_64.AppImage --appdir installer/linux/AppDir --output appimage | |
mv Digstore*.AppImage installer/linux/digstore-linux-x86_64.AppImage | |
- name: Upload Linux Packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: digstore-linux-installers | |
path: | | |
installer/linux/digstore_0.1.0_amd64.deb | |
installer/linux/digstore-0.1.0-1.x86_64.rpm | |
installer/linux/digstore-linux-x86_64.AppImage | |
retention-days: 30 | |
create-release: | |
name: Create Release and Upload Assets | |
runs-on: ubuntu-latest | |
needs: [build-windows-installer, build-macos-installer, build-linux-packages] | |
if: github.event_name == 'push' && contains(github.event.head_commit.message, '.') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate version consistency | |
id: version | |
run: | | |
COMMIT_MSG="${{ github.event.head_commit.message }}" | |
COMMIT_VERSION=$(echo "$COMMIT_MSG" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) | |
if [ -z "$COMMIT_VERSION" ]; then | |
echo "No version found in commit message" | |
exit 1 | |
fi | |
# Check that Cargo.toml version matches commit message | |
CARGO_VERSION=$(grep '^version = ' Cargo.toml | head -1 | cut -d '"' -f 2) | |
if [ "$CARGO_VERSION" != "$COMMIT_VERSION" ]; then | |
echo "ERROR: Version mismatch! Commit: $COMMIT_VERSION, Cargo.toml: $CARGO_VERSION" | |
exit 1 | |
fi | |
echo "version=$COMMIT_VERSION" >> $GITHUB_OUTPUT | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts/ | |
- name: Prepare Release Assets | |
run: | | |
mkdir -p ./release-assets/ | |
# Copy installer files | |
find ./artifacts/ -name "*.msi" -exec cp {} ./release-assets/ \; | |
find ./artifacts/ -name "*.dmg" -exec cp {} ./release-assets/ \; | |
find ./artifacts/ -name "*.deb" -exec cp {} ./release-assets/ \; | |
find ./artifacts/ -name "*.rpm" -exec cp {} ./release-assets/ \; | |
find ./artifacts/ -name "*.AppImage" -exec cp {} ./release-assets/ \; | |
cd ./release-assets/ | |
# Generate checksums | |
echo "# Digstore v${{ steps.version.outputs.version }} - SHA256 Checksums" > checksums.txt | |
echo "" >> checksums.txt | |
for file in *; do | |
if [ -f "$file" ] && [ "$file" != "checksums.txt" ]; then | |
CHECKSUM=$(sha256sum "$file" | cut -d' ' -f1) | |
echo "$file: $CHECKSUM" >> checksums.txt | |
fi | |
done | |
echo "Release assets prepared:" | |
ls -la | |
- name: Create GitHub Releases | |
run: | | |
VERSION="${{ steps.version.outputs.version }}" | |
# Create versioned release | |
gh release create "v$VERSION" \ | |
--title "Digstore v$VERSION" \ | |
--notes "## Digstore v$VERSION | |
### Downloads | |
- **Windows**: [digstore-windows-x64.msi](https://github.com/DIG-Network/digstore/releases/download/v$VERSION/digstore-windows-x64.msi) | |
- **macOS**: [digstore-macos.dmg](https://github.com/DIG-Network/digstore/releases/download/v$VERSION/digstore-macos.dmg) | |
- **Linux**: [digstore-linux-x86_64.AppImage](https://github.com/DIG-Network/digstore/releases/download/v$VERSION/digstore-linux-x86_64.AppImage) | |
- **Checksums**: [checksums.txt](https://github.com/DIG-Network/digstore/releases/download/v$VERSION/checksums.txt) | |
**🔒 Security**: Always verify checksums before installation" \ | |
./release-assets/* | |
# Update latest-build release | |
gh release delete latest-build --yes || true | |
git push --delete origin latest-build || true | |
gh release create latest-build \ | |
--title "Latest Build (Development)" \ | |
--notes "**Version**: $VERSION | **Build**: $(date -u '+%Y-%m-%d %H:%M:%S UTC') | |
🔒 **Security**: Verify checksums | ⚠️ **Development Build**" \ | |
--prerelease \ | |
./release-assets/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
create-universal-install-script: | |
name: Create Universal Install Script | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create Install Script | |
run: | | |
mkdir -p installer | |
cat > installer/install.sh << 'EOF' | |
#!/bin/bash | |
set -e | |
# Digstore Min Universal Installer | |
VERSION="0.1.0" | |
REPO="${{ github.repository }}" | |
echo "Digstore Min Installer v$VERSION" | |
echo "================================" | |
echo "" | |
# Detect OS and architecture | |
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | |
ARCH=$(uname -m) | |
case $OS in | |
linux) | |
echo "Detected Linux system" | |
# Check for package managers | |
if command -v apt-get >/dev/null; then | |
echo "Debian/Ubuntu system detected" | |
echo "Download the .deb package from:" | |
echo "https://github.com/$REPO/releases/latest/download/digstore_${VERSION}_amd64.deb" | |
echo "" | |
echo "Install with: sudo dpkg -i digstore_${VERSION}_amd64.deb" | |
elif command -v yum >/dev/null || command -v dnf >/dev/null; then | |
echo "RedHat/Fedora system detected" | |
echo "Download the .rpm package from:" | |
echo "https://github.com/$REPO/releases/latest/download/digstore-${VERSION}-1.x86_64.rpm" | |
echo "" | |
echo "Install with: sudo rpm -i digstore-${VERSION}-1.x86_64.rpm" | |
else | |
echo "Generic Linux system detected" | |
echo "Download the AppImage from:" | |
echo "https://github.com/$REPO/releases/latest/download/digstore-linux-x86_64.AppImage" | |
echo "" | |
echo "Make executable with: chmod +x digstore-linux-x86_64.AppImage" | |
fi | |
;; | |
darwin) | |
echo "macOS system detected" | |
echo "Download the .dmg installer from:" | |
echo "https://github.com/$REPO/releases/latest/download/digstore-macos.dmg" | |
echo "" | |
echo "Open the DMG and drag Digstore Min to Applications" | |
;; | |
mingw*|msys*|cygwin*) | |
echo "Windows system detected" | |
echo "Download the .msi installer from:" | |
echo "https://github.com/$REPO/releases/latest/download/digstore-windows-x64.msi" | |
echo "" | |
echo "Run the MSI installer to install Digstore Min" | |
;; | |
*) | |
echo "Unsupported OS: $OS" | |
echo "Please build from source:" | |
echo "cargo install --git https://github.com/$REPO" | |
exit 1 | |
;; | |
esac | |
echo "" | |
echo "After installation, run 'digstore --help' to get started!" | |
EOF | |
chmod +x installer/install.sh | |
- name: Upload Install Script | |
uses: actions/upload-artifact@v4 | |
with: | |
name: universal-install-script | |
path: installer/install.sh | |
retention-days: 30 | |
summary: | |
name: Build Summary | |
needs: [build-windows-installer, build-macos-installer, build-linux-packages, create-universal-install-script] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: List artifacts | |
run: | | |
echo "Downloaded artifacts:" | |
find artifacts -type f -ls | |
- name: Create artifact download URLs | |
id: urls | |
run: | | |
echo "## 📥 Download Links" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "You can download the installers from the workflow artifacts:" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "- [View all artifacts](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts)" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "**Note:** These artifacts will be available for 30 days. For permanent downloads, wait for the 'Latest Build' release to be updated." >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
- name: Summary | |
run: | | |
echo "# Build Summary" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "## 📦 Installers Built Successfully" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "| Platform | Installer Type | Artifact Name |" >> $GITHUB_STEP_SUMMARY | |
echo "|----------|----------------|---------------|" >> $GITHUB_STEP_SUMMARY | |
echo "| Windows | MSI | digstore-windows-x64.msi |" >> $GITHUB_STEP_SUMMARY | |
echo "| macOS | DMG | digstore-macos.dmg |" >> $GITHUB_STEP_SUMMARY | |
echo "| Linux | DEB | digstore_0.1.0_amd64.deb |" >> $GITHUB_STEP_SUMMARY | |
echo "| Linux | RPM | digstore-0.1.0-1.x86_64.rpm |" >> $GITHUB_STEP_SUMMARY | |
echo "| Linux | AppImage | digstore-linux-x86_64.AppImage |" >> $GITHUB_STEP_SUMMARY | |
echo "| All | Script | install.sh |" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "## 🚀 Installation Methods" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "### Windows" >> $GITHUB_STEP_SUMMARY | |
echo "Run the MSI installer (requires Administrator privileges) which will:" >> $GITHUB_STEP_SUMMARY | |
echo "- Install to Program Files" >> $GITHUB_STEP_SUMMARY | |
echo "- Add to system PATH automatically" >> $GITHUB_STEP_SUMMARY | |
echo "- Create Start Menu shortcuts" >> $GITHUB_STEP_SUMMARY | |
echo "- **Important**: Restart your terminal or log out/in for PATH changes to take effect" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "### macOS" >> $GITHUB_STEP_SUMMARY | |
echo "1. Mount the DMG file" >> $GITHUB_STEP_SUMMARY | |
echo "2. Drag Digstore Min to Applications" >> $GITHUB_STEP_SUMMARY | |
echo "3. Add /Applications/DIG Network Digstore.app/Contents/MacOS to PATH" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "### Linux" >> $GITHUB_STEP_SUMMARY | |
echo "- **Debian/Ubuntu**: \`sudo dpkg -i digstore_0.1.0_amd64.deb\`" >> $GITHUB_STEP_SUMMARY | |
echo "- **Fedora/RHEL**: \`sudo rpm -i digstore-0.1.0-1.x86_64.rpm\`" >> $GITHUB_STEP_SUMMARY | |
echo "- **Any Linux**: \`chmod +x digstore-linux-x86_64.AppImage && ./digstore-linux-x86_64.AppImage\`" >> $GITHUB_STEP_SUMMARY |