Skip to content

Merge branch 'master' into release #78

Merge branch 'master' into release

Merge branch 'master' into release #78

Workflow file for this run

name: 'Publish'
on:
push:
branches:
- release
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-14' # Apple Silicon runner
args: '--target aarch64-apple-darwin'
arch: 'aarch64'
- platform: 'macos-15' # Intel runner
args: '--target x86_64-apple-darwin'
arch: 'x86_64'
- platform: 'windows-latest'
args: ''
arch: 'x86_64'
- platform: 'ubuntu-24.04'
args: ''
arch: 'amd64'
- platform: 'ubuntu-24.04-arm'
args: ''
arch: 'arm64'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.91.1
targets: ${{ matrix.platform == 'macos-14' && 'aarch64-apple-darwin' || matrix.platform == 'macos-15' && 'x86_64-apple-darwin' || '' }}
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --fix-missing \
libwebkit2gtk-4.1-0=2.44.0-2 \
libwebkit2gtk-4.1-dev=2.44.0-2 \
libjavascriptcoregtk-4.1-0=2.44.0-2 \
libjavascriptcoregtk-4.1-dev=2.44.0-2 \
gir1.2-javascriptcoregtk-4.1=2.44.0-2 \
gir1.2-webkit2-4.1=2.44.0-2 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
libgtk-3-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
xdg-utils
- name: Install Frontend Dependencies
run: bun install
- name: Clean Binaries Directory
shell: bash
run: rm -rf src-tauri/binaries
- name: Cache FFmpeg Binaries
id: cache-ffmpeg
uses: actions/cache@v4
with:
path: src-tauri/binaries
key: ffmpeg-binaries-${{ matrix.platform }}-${{ matrix.arch }}-v3
- name: Setup FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
shell: bash
run: |
# Ensure unzip is available (Linux/Windows need it, macOS has it)
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y unzip
fi
# Run the setup script with target architecture
node scripts/setup-ffmpeg.cjs --arch ${{ matrix.arch }}
- name: Setup Upscaler (Common)
if: runner.os != 'Linux' || matrix.arch != 'arm64'
run: node scripts/setup-upscaler.cjs --arch ${{ matrix.arch }}
- name: Setup Upscaler (Linux ARM64 Build)
if: runner.os == 'Linux' && matrix.arch == 'arm64'
run: |
# Install build deps
sudo apt-get update
sudo apt-get install -y cmake libvulkan-dev glslang-dev glslang-tools libgomp1
# Force git to use HTTPS instead of SSH for submodules
git config --global url."https://github.com/".insteadOf "git@github.com:"
# Clone repo with submodules
git clone --recursive https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan.git
cd Real-ESRGAN-ncnn-vulkan
# Build
mkdir build && cd build
cmake ../src
make -j$(nproc)
# Move binary
cd ../..
mkdir -p src-tauri/binaries
mv Real-ESRGAN-ncnn-vulkan/build/realesrgan-ncnn-vulkan src-tauri/binaries/realesrgan-ncnn-vulkan-aarch64-unknown-linux-gnu
chmod +x src-tauri/binaries/realesrgan-ncnn-vulkan-aarch64-unknown-linux-gnu
# Cleanup
rm -rf Real-ESRGAN-ncnn-vulkan
- name: Get Version
id: get_version
shell: bash
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Get Release Notes
id: release_notes
shell: bash
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
# Extract changelog entry using awk
# Looks for line starting with "## [VERSION]" and prints until next line starting with "## "
NOTES=$(awk -v ver="[$VERSION]" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p' CHANGELOG.md)
if [ -z "$NOTES" ]; then
NOTES="See the assets to download this version and install."
fi
# Output multiline string to GITHUB_OUTPUT
{
echo "BODY<<EOF"
echo "$NOTES"
echo "EOF"
} >> $GITHUB_OUTPUT
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: __VERSION__
releaseName: 'v__VERSION__'
releaseBody: ${{ steps.release_notes.outputs.BODY }}
releaseDraft: false
prerelease: false
args: ${{ matrix.args != '' && format('{0} -- --locked', matrix.args) || '-- --locked' }}
tauriScript: 'bun tauri'
update-tap:
needs: publish-tauri
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
path: source
- name: Checkout Tap Repository
uses: actions/checkout@v4
with:
repository: 66HEX/homebrew-frame
token: ${{ secrets.TAP_GITHUB_TOKEN }}
path: tap
- name: Get Version
id: version
working-directory: source
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Calculate Hashes
id: hashes
env:
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
# URLs for the newly published artifacts
URL_ARM="https://github.com/66HEX/frame/releases/download/${VERSION}/Frame_${VERSION}_aarch64.dmg"
URL_INTEL="https://github.com/66HEX/frame/releases/download/${VERSION}/Frame_${VERSION}_x64.dmg"
echo "Downloading artifacts for analysis..."
echo "ARM: $URL_ARM"
curl -L --fail -o frame-arm.dmg "$URL_ARM"
echo "Intel: $URL_INTEL"
curl -L --fail -o frame-intel.dmg "$URL_INTEL"
echo "Calculating SHA256 hashes..."
HASH_ARM=$(sha256sum frame-arm.dmg | awk '{print $1}')
HASH_INTEL=$(sha256sum frame-intel.dmg | awk '{print $1}')
echo "ARM: $HASH_ARM"
echo "INTEL: $HASH_INTEL"
echo "HASH_ARM=$HASH_ARM" >> $GITHUB_OUTPUT
echo "HASH_INTEL=$HASH_INTEL" >> $GITHUB_OUTPUT
- name: Update Cask
working-directory: tap
env:
VERSION: ${{ steps.version.outputs.VERSION }}
HASH_ARM: ${{ steps.hashes.outputs.HASH_ARM }}
HASH_INTEL: ${{ steps.hashes.outputs.HASH_INTEL }}
run: |
mkdir -p Casks
cat <<EOF > Casks/frame.rb
cask "frame" do
arch arm: "aarch64", intel: "x64"
version "$VERSION"
sha256 arm: "$HASH_ARM",
intel: "$HASH_INTEL"
url "https://github.com/66HEX/frame/releases/download/#{version}/Frame_#{version}_#{arch}.dmg"
name "Frame"
desc "High-performance media conversion utility"
homepage "https://github.com/66HEX/frame"
auto_updates true
app "Frame.app"
zap trash: [
"~/Library/Application Support/com.66hex.frame",
"~/Library/Caches/com.66hex.frame",
"~/Library/Preferences/com.66hex.frame.plist",
"~/Library/Saved Application State/com.66hex.frame.savedState",
]
caveats <<~EOS
Frame is not notarized. On first launch, you may need to:
1. Right-click the app and select "Open".
2. Click "Open" in the security dialog.
Alternatively, you can run:
xattr -dr com.apple.quarantine /Applications/Frame.app
EOS
end
EOF
# Commit and Push
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/frame.rb
# Check if there are changes before committing to avoid failure
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "Update Frame to v$VERSION"
git push
fi
publish-winget:
needs: publish-tauri
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Get Version
id: version
shell: pwsh
run: |
$version = (Get-Content package.json | ConvertFrom-Json).version
"VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Publish release to WinGet
uses: vedantmgoyal9/winget-releaser@v2
with:
identifier: 66HEX.Frame
installers-regex: 'x64\-setup\.exe$'
release-tag: ${{ steps.version.outputs.VERSION }}
token: ${{ secrets.WINGET_ACC_TOKEN }}