Skip to content

Commit

Permalink
fix: brew macos release
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Nov 26, 2024
1 parent 167fa29 commit 02e3e9f
Showing 1 changed file with 24 additions and 105 deletions.
129 changes: 24 additions & 105 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# # Run for macOS
# act -W .github/workflows/release-cli.yml --container-architecture linux/amd64 -j build-macos -P macos-latest=-self-hosted

# # Run for Linux
# act -W .github/workflows/release-cli.yml --container-architecture linux/amd64 -j build-ubuntu -P ubuntu-24.04

name: Release CLI

on:
Expand Down Expand Up @@ -65,7 +62,6 @@ jobs:
export RUSTFLAGS="-C link-arg=-Wl,-rpath,@executable_path/../lib -C link-arg=-Wl,-rpath,@loader_path/../lib"
cargo build --release --features pipes,metal --target ${{ matrix.target }}
# get the current tag or take latest (in the case of a workflow dispatch)
- name: Set version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
Expand Down Expand Up @@ -99,6 +95,29 @@ jobs:
run: |
echo "MAC_SHA256_${{ matrix.target }}=$(shasum -a 256 screenpipe-*.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: screenpipe-macos-${{ matrix.target }}
path: screenpipe-*.tar.gz

update-homebrew:
needs: build-macos
runs-on: macos-latest
steps:
- name: Set version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION=$(git ls-remote --tags --refs --sort="version:refname" | tail -n1 | sed 's/.*\///' | sed 's/^v//')
fi
if [[ -z "$VERSION" ]]; then
VERSION="0.0.0"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Set version to: $VERSION"
- name: Update Homebrew Formula
env:
GH_TOKEN: ${{ secrets.PAT }}
Expand All @@ -109,113 +128,13 @@ jobs:
--message="Automated update to version ${VERSION}" \
--no-browse
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: screenpipe-macos-${{ matrix.target }}
path: screenpipe-*.tar.gz

# build-ubuntu:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y libavformat-dev libavfilter-dev libavdevice-dev ffmpeg libasound2-dev

# - name: Set up Rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true

# - name: Build with RPATH
# run: |
# export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH"
# export RUSTFLAGS="-C link-arg=-Wl,-rpath,\$ORIGIN/lib"
# cargo build --release

# - name: Copy FFmpeg libraries
# run: |
# mkdir -p target/release/lib
# cp /usr/lib/x86_64-linux-gnu/libavcodec.so* target/release/lib/
# cp /usr/lib/x86_64-linux-gnu/libavformat.so* target/release/lib/
# cp /usr/lib/x86_64-linux-gnu/libavutil.so* target/release/lib/
# cp /usr/lib/x86_64-linux-gnu/libswresample.so* target/release/lib/
# cp /usr/lib/x86_64-linux-gnu/libswscale.so* target/release/lib/
# cp /usr/lib/x86_64-linux-gnu/libavfilter.so* target/release/lib/
# cp /usr/lib/x86_64-linux-gnu/libavdevice.so* target/release/lib/

# - name: Create deployment package
# run: |
# mkdir -p screenpipe-linux
# cp target/release/screenpipe screenpipe-linux/screenpipe
# cp -r target/release/lib screenpipe-linux/
# chmod +x screenpipe-linux/screenpipe
# tar -czvf screenpipe-linux.tar.gz screenpipe-linux

# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: screenpipe-linux
# path: screenpipe-linux.tar.gz

# build-windows:
# runs-on: windows-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Set up Rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true

# - name: Download FFmpeg
# run: |
# $ProgressPreference = 'SilentlyContinue'
# Invoke-WebRequest -Uri "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl-shared.zip" -OutFile "ffmpeg.zip"
# Expand-Archive -Path "ffmpeg.zip" -DestinationPath "ffmpeg"
# Move-Item -Path "ffmpeg\ffmpeg-master-latest-win64-gpl-shared" -Destination "C:\ffmpeg"

# - name: Set up environment
# run: |
# echo "C:\ffmpeg\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# echo "FFMPEG_DIR=C:\ffmpeg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "PKG_CONFIG_PATH=C:\ffmpeg\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

# - name: Build release
# run: |
# cargo build --release --verbose

# - name: Create deployment package
# run: |
# $VERSION = $env:GITHUB_REF -replace 'refs/tags/v', ''
# New-Item -ItemType Directory -Path "screenpipe-win64"
# Copy-Item "target\release\screenpipe.exe" -Destination "screenpipe-win64"
# Copy-Item "C:\ffmpeg\bin\*.dll" -Destination "screenpipe-win64"
# Compress-Archive -Path "screenpipe-win64" -DestinationPath "screenpipe-$VERSION-x86_64-pc-windows-msvc.zip"

# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: screenpipe-windows
# path: screenpipe-*.zip

release:
runs-on: ubuntu-latest
needs: [build-macos] # ubuntu, build-windows windows not supported atm, build from source bro
needs: [build-macos, update-homebrew]
steps:
- name: Checkout code
uses: actions/checkout@v4

# get the current tag or take latest (in the case of a workflow dispatch)
- name: Set version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
Expand Down

0 comments on commit 02e3e9f

Please sign in to comment.