Add support for ubi and mise

This commit is contained in:
f-trycua
2025-03-17 11:28:01 +01:00
parent 8940a8c203
commit c33c1d653e
2 changed files with 58 additions and 16 deletions

View File

@@ -154,10 +154,17 @@ jobs:
id: generate_checksums
working-directory: ./libs/lume/.release
run: |
echo "## SHA256 Checksums" > checksums.txt
echo '```' >> checksums.txt
shasum -a 256 lume.tar.gz >> checksums.txt
echo '```' >> checksums.txt
# Use existing checksums file if it exists, otherwise generate one
if [ -f "checksums.txt" ]; then
echo "Using existing checksums file"
cat checksums.txt
else
echo "## SHA256 Checksums" > checksums.txt
echo '```' >> checksums.txt
shasum -a 256 lume*.tar.gz >> checksums.txt
echo '```' >> checksums.txt
fi
checksums=$(cat checksums.txt)
echo "checksums<<EOF" >> $GITHUB_OUTPUT
echo "$checksums" >> $GITHUB_OUTPUT
@@ -168,16 +175,32 @@ jobs:
with:
name: lume-notarized
path: |
./libs/lume/.release/lume.tar.gz
./libs/lume/.release/lume.pkg.tar.gz
./libs/lume/.release/lume*.tar.gz
./libs/lume/.release/lume*.pkg.tar.gz
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
./libs/lume/.release/lume.tar.gz
./libs/lume/.release/lume.pkg.tar.gz
./libs/lume/.release/lume*.tar.gz
./libs/lume/.release/lume*.pkg.tar.gz
body: |
${{ steps.generate_checksums.outputs.checksums }}
### Installation with Mise and Ubi
```
mise use -g ubi:trycua/cua
# Or run it directly
mise x ubi:trycua/cua@latest -- lume
```
### Installation with Brew
```
brew tap trycua/lume
brew install lume
```
generate_release_notes: true

View File

@@ -44,6 +44,9 @@ for var in "${required_vars[@]}"; do
fi
done
# Get VERSION from environment or use default
VERSION=${VERSION:-"0.1.0"}
# Move to the project root directory
pushd ../../ > /dev/null
@@ -138,19 +141,35 @@ if [ "$LOG_LEVEL" != "minimal" ] && [ "$LOG_LEVEL" != "none" ]; then
sudo ln -sf "$(pwd)/lume" /usr/local/bin/lume
fi
# Create archives of the package
log "essential" "Creating archives..."
# Get architecture and create OS identifier
ARCH=$(uname -m)
OS_IDENTIFIER="darwin-${ARCH}"
# Create archives of the package with OS identifier in the name
log "essential" "Creating archives with OS identifier..."
cd "$(dirname "$PKG_PATH")"
tar -czf lume.tar.gz lume > /dev/null 2>&1
tar -czf lume.pkg.tar.gz lume.pkg > /dev/null 2>&1
# Create both original and OS-specific archives (for backward compatibility)
tar -czf "lume-${OS_IDENTIFIER}.tar.gz" lume > /dev/null 2>&1
tar -czf "lume-${OS_IDENTIFIER}.pkg.tar.gz" lume.pkg > /dev/null 2>&1
# Also create the original names for backward compatibility
cp "lume-${OS_IDENTIFIER}.tar.gz" lume.tar.gz
cp "lume-${OS_IDENTIFIER}.pkg.tar.gz" lume.pkg.tar.gz
# Create version-specific archives if VERSION is provided
if [ -n "$VERSION" ]; then
cp "lume-${OS_IDENTIFIER}.tar.gz" "lume-${VERSION}-${OS_IDENTIFIER}.tar.gz"
cp "lume-${OS_IDENTIFIER}.pkg.tar.gz" "lume-${VERSION}-${OS_IDENTIFIER}.pkg.tar.gz"
fi
# Create sha256 checksum for the lume tarball but don't display details in logs
if [ "$LOG_LEVEL" = "minimal" ] || [ "$LOG_LEVEL" = "none" ]; then
shasum -a 256 lume.tar.gz > /dev/null
log "essential" "Package created successfully with checksum generated."
shasum -a 256 lume*.tar.gz > checksums.txt
log "essential" "Package created successfully with checksums generated."
else
log "normal" "Creating checksum..."
shasum -a 256 lume.tar.gz
log "normal" "Creating checksums..."
shasum -a 256 lume*.tar.gz | tee checksums.txt
fi
popd > /dev/null