whoops I need binaries #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build phantomake binary | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-binary-unix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
binary-name: macos | |
- os: ubuntu-latest | |
binary-name: linux | |
permissions: | |
contents: write | |
defaults: | |
run: | |
working-directory: ./packages/phantomake/ | |
steps: | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Bun install | |
run: | | |
bun install | |
- name: Build phantomake | |
run: | | |
bun run build | |
tar -zcvf phantomake-${{ matrix.binary-name }}.tar.gz phantomake | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: phantomake-${{ matrix.binary-name }} | |
path: ./packages/phantomake/phantomake-${{ matrix.binary-name }} | |
- name: Upload binary to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./packages/phantomake/phantomake-${{ matrix.binary-name }}.tar.gz | |
build-binary-windows: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
defaults: | |
run: | |
working-directory: ./packages/phantomake/ | |
steps: | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Bun install | |
run: | | |
bun install | |
- name: Build phantomake (Windows) | |
run: | | |
bun run build | |
Compress-Archive -Path phantomake.exe -Destination phantomake-windows.zip | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: phantomake-windows.exe | |
path: ./packages/phantomake/phantomake.exe | |
- name: Upload binary to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./packages/phantomake/phantomake-windows.zip | |
upload-source: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Make source tarball | |
run: | | |
git archive --format=tar.gz -o source.tar.gz --prefix=phantomake/ HEAD | |
- name: Upload tarball to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: source.tar.gz | |
publish-tauri: | |
needs: [build-binary-unix, build-binary-windows] | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: 'macos-latest' | |
args: '--target universal-apple-darwin' | |
artifact-name: phantomake-macos | |
- platform: 'ubuntu-latest' | |
args: '' | |
artifact-name: phantomake-linux | |
- platform: 'windows-latest' | |
args: '' | |
artifact-name: phantomake-windows.exe | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies (ubuntu only) | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. | |
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: './packages/gui/src-tauri -> target' | |
- name: install frontend dependencies | |
working-directory: ./packages/gui/ | |
run: bun install | |
- name: Download binary artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.artifact-name }} | |
- name: Copy Phantomake binary to tauri binaries dir (Unix) | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
mv ${{ matrix.artifact-name }} ./packages/gui/src-tauri/binaries/phantomake-$(rustc -Vv | grep host | cut -f2 -d' ') | |
- name: Copy Phantomake binary to tauri binaries dir (MacOS) | |
if: matrix.platform == 'macos-latest' | |
run: | | |
mv ${{ matrix.artifact-name }} ./packages/gui/src-tauri/binaries/phantomake-universal-apple-darwin | |
ln -s ./packages/gui/src-tauri/binaries/phantomake-universal-apple-darwin ./packages/gui/src-tauri/binaries/phantomake-aarch64-apple-darwin | |
ln -s ./packages/gui/src-tauri/binaries/phantomake-universal-apple-darwin ./packages/gui/src-tauri/binaries/phantomake-x86_64-apple-darwin | |
- name: Copy Phantomake binary to tauri binaries dir (Windows) | |
if: matrix.platform == 'windows-latest' | |
run: | | |
Move-Item -Path ${{ matrix.artifact-name }} -Destination .\packages\gui\src-tauri\binaries\phantomake-$(rustc -Vv | Select-String "host:" | ForEach-Object {$_.Line.split(" ")[1]}).exe | |
- uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tagName: ${{ github.ref_name }} | |
releaseName: ${{ github.ref_name }} | |
args: ${{ matrix.args }} | |
projectPath: ./packages/gui | |
tauriScript: bun tauri |