From c33c1d653e1af569d60eaaf8987f23d29f5a041e Mon Sep 17 00:00:00 2001 From: f-trycua Date: Mon, 17 Mar 2025 11:28:01 +0100 Subject: [PATCH] Add support for ubi and mise --- .github/workflows/publish-lume.yml | 39 +++++++++++++++---- .../scripts/build/build-release-notarized.sh | 35 +++++++++++++---- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish-lume.yml b/.github/workflows/publish-lume.yml index 2aea4862..9894fb91 100644 --- a/.github/workflows/publish-lume.yml +++ b/.github/workflows/publish-lume.yml @@ -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<> $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 \ No newline at end of file diff --git a/libs/lume/scripts/build/build-release-notarized.sh b/libs/lume/scripts/build/build-release-notarized.sh index 9b4f4786..a718e981 100755 --- a/libs/lume/scripts/build/build-release-notarized.sh +++ b/libs/lume/scripts/build/build-release-notarized.sh @@ -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