Skip to content

Add global non-interactive mode flag for all CLI commands #9

Add global non-interactive mode flag for all CLI commands

Add global non-interactive mode flag for all CLI commands #9

Workflow file for this run

name: Release
on:
push:
branches: [ main ]
# Only trigger on commits with version numbers in the message
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.event.head_commit.message, '.')
outputs:
version: ${{ steps.version.outputs.version }}
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- name: Extract version from commit message
id: version
run: |
COMMIT_MSG="${{ github.event.head_commit.message }}"
VERSION=$(echo "$COMMIT_MSG" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
echo "Detected version: $VERSION"
if [ -z "$VERSION" ]; then
echo "No version found in commit message"
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Versioned GitHub Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: "Digstore v${{ steps.version.outputs.version }}"
body: |
## Digstore v${{ steps.version.outputs.version }}
### Downloads
- **Windows**: [digstore-windows-x64.msi](https://github.com/DIG-Network/digstore/releases/download/v${{ steps.version.outputs.version }}/digstore-windows-x64.msi)
- **macOS**: [digstore-macos.dmg](https://github.com/DIG-Network/digstore/releases/download/v${{ steps.version.outputs.version }}/digstore-macos.dmg)
- **Linux**: [digstore-linux-x86_64.AppImage](https://github.com/DIG-Network/digstore/releases/download/v${{ steps.version.outputs.version }}/digstore-linux-x86_64.AppImage)
### Installation
#### Windows
```powershell
# Download and install silently
Invoke-WebRequest -Uri "https://github.com/DIG-Network/digstore/releases/download/v${{ steps.version.outputs.version }}/digstore-windows-x64.msi" -OutFile "digstore.msi"
msiexec /i digstore.msi /quiet /norestart
```
#### macOS
```bash
# Download and install
curl -L -o digstore.dmg "https://github.com/DIG-Network/digstore/releases/download/v${{ steps.version.outputs.version }}/digstore-macos.dmg"
hdiutil attach digstore.dmg
cp -r "/Volumes/Digstore/Digstore Min.app" /Applications/
hdiutil detach "/Volumes/Digstore"
```
#### Linux
```bash
# AppImage (universal)
curl -L -o digstore "https://github.com/DIG-Network/digstore/releases/download/v${{ steps.version.outputs.version }}/digstore-linux-x86_64.AppImage"
chmod +x digstore
sudo mv digstore /usr/local/bin/
```
### Auto-Update
If you have Digstore installed, you can update using:
```bash
digstore update
```
---
**Full Changelog**: https://github.com/DIG-Network/digstore/compare/v${{ steps.version.outputs.version }}...main
draft: false
prerelease: false
- name: Update Latest Build Release
run: |
VERSION="${{ steps.version.outputs.version }}"
# Delete existing latest-build tag and release if it exists
gh release delete latest-build --yes || echo "No existing latest-build release"
git push --delete origin latest-build || echo "No existing latest-build tag"
# Create new latest-build release
gh release create latest-build \
--title "Latest Build (Development)" \
--notes "## Latest Development Build
This is the latest development build of Digstore.
**Current Version**: $VERSION
**Build Date**: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
**Commit**: ${{ github.sha }}
### Downloads
- **Windows**: [digstore-windows-x64.msi](https://github.com/DIG-Network/digstore/releases/download/latest-build/digstore-windows-x64.msi)
- **macOS**: [digstore-macos.dmg](https://github.com/DIG-Network/digstore/releases/download/latest-build/digstore-macos.dmg)
- **Linux**: [digstore-linux-x86_64.AppImage](https://github.com/DIG-Network/digstore/releases/download/latest-build/digstore-linux-x86_64.AppImage)
### Auto-Update
\`\`\`bash
digstore update
\`\`\`
---
**⚠️ Development Build**: This build may contain experimental features and should be used for testing only." \
--prerelease
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
wait-for-installers:
name: Wait for Installers
runs-on: ubuntu-latest
needs: create-release
if: needs.create-release.outputs.release_created
steps:
- name: Wait for installer workflows
run: |
echo "Waiting for installer builds to complete..."
sleep 300 # Wait 5 minutes for installers to build
echo "Installer builds should be complete"
upload-release-assets:
name: Upload Release Assets
runs-on: ubuntu-latest
needs: [create-release, wait-for-installers]
if: needs.create-release.outputs.release_created
steps:
- uses: actions/checkout@v4
- name: Download Windows Installer
uses: actions/download-artifact@v4
with:
name: digstore-windows-installer
path: ./installers/
- name: Download macOS Installer
uses: actions/download-artifact@v4
with:
name: digstore-macos-installer
path: ./installers/
- name: Download Linux Packages
uses: actions/download-artifact@v4
with:
name: digstore-linux-packages
path: ./installers/
- name: Upload Release Assets
run: |
# Upload all installer files to both versioned and latest-build releases
VERSION="${{ needs.create-release.outputs.version }}"
# Upload Windows MSI
if [ -f "./installers/digstore-windows-x64.msi" ]; then
gh release upload "v$VERSION" "./installers/digstore-windows-x64.msi" --clobber
gh release upload "latest-build" "./installers/digstore-windows-x64.msi" --clobber
fi
# Upload macOS DMG
if [ -f "./installers/digstore-macos.dmg" ]; then
gh release upload "v$VERSION" "./installers/digstore-macos.dmg" --clobber
gh release upload "latest-build" "./installers/digstore-macos.dmg" --clobber
fi
# Upload Linux packages
for file in ./installers/*.{deb,rpm,AppImage}; do
if [ -f "$file" ]; then
gh release upload "v$VERSION" "$file" --clobber
gh release upload "latest-build" "$file" --clobber
fi
done
echo "✓ Uploaded assets to both v$VERSION and latest-build releases"
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}