Skip to content

Use macos-13 (Intel) runner for x86_64 desktop build #7

Use macos-13 (Intel) runner for x86_64 desktop build

Use macos-13 (Intel) runner for x86_64 desktop build #7

Workflow file for this run

name: Release
on:
push:
tags:
- "release-[0-9]+.[0-9]+.[0-9]+*"
permissions:
contents: write
jobs:
build-cli:
strategy:
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
artifact: ralph-macos-arm64
- target: x86_64-apple-darwin
os: macos-latest
artifact: ralph-macos-x86_64
- target: x86_64-pc-windows-msvc
os: windows-latest
artifact: ralph-windows-x86_64
- target: aarch64-pc-windows-msvc
os: windows-latest
artifact: ralph-windows-arm64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact: ralph-linux-x86_64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
artifact: ralph-linux-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools (Linux ARM64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
run: cargo build --release --target ${{ matrix.target }} -p ralph-cli
- name: Prepare artifact (Unix)
if: runner.os != 'Windows'
run: |
cp target/${{ matrix.target }}/release/ralph ${{ matrix.artifact }}
chmod +x ${{ matrix.artifact }}
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
run: cp target/${{ matrix.target }}/release/ralph.exe ${{ matrix.artifact }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}${{ runner.os == 'Windows' && '.exe' || '' }}
build-desktop:
strategy:
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
artifact: ralph-desktop-macos-arm64
- os: macos-13
target: x86_64-apple-darwin
artifact: ralph-desktop-macos-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact: ralph-desktop-windows-x86_64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: ralph-desktop-linux-x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install frontend dependencies
run: npm ci
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build Tauri app
id: tauri
uses: tauri-apps/tauri-action@v0
with:
args: --target ${{ matrix.target }}
includeUpdaterJson: false
- name: Upload desktop artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: |
target/${{ matrix.target }}/release/bundle/dmg/*.dmg
target/${{ matrix.target }}/release/bundle/macos/*.app
target/${{ matrix.target }}/release/bundle/nsis/*.exe
target/${{ matrix.target }}/release/bundle/msi/*.msi
target/${{ matrix.target }}/release/bundle/deb/*.deb
target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
release:
needs: [build-cli, build-desktop]
runs-on: ubuntu-latest
steps:
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#release-}" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.version.outputs.version }}
generate_release_notes: true
body: |
## macOS CLI notice
macOS may block the CLI binary with a Gatekeeper warning. To fix, run:
```
xattr -d com.apple.quarantine <path-to-binary>
```
files: artifacts/**/*