Skip to content

Commit

Permalink
Automatically release Tauri binaries
Browse files Browse the repository at this point in the history
This makes it so we automatically release the Tauri binaries when we
merge a new change to the master branch.
  • Loading branch information
CryZe committed Jul 21, 2024
1 parent da502a6 commit e751454
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build_zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set -ex

main() {
local src=$(pwd) \
stage=

if [[ $OS_NAME =~ ^macos\-.*$ ]]; then
stage=$(mktemp -d -t tmp)
else
stage=$(mktemp -d)
fi

ls -lhA src-tauri/target/release/
cp "src-tauri/target/release/LiveSplit One.exe" "$stage/LiveSplit One.exe" 2>/dev/null || :

cd $stage
if [ "$OS_NAME" = "windows-latest" ]; then
7z a $src/LiveSplitOne-$TARGET.zip *
else
tar czf $src/LiveSplitOne-$TARGET.tar.gz *
fi
cd $src

rm -rf $stage
}

main
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
Expand All @@ -34,6 +36,7 @@ jobs:
target: x86_64-pc-windows-msvc
binaryen: x86_64-windows
cargo_bin: C:/Users/runneradmin/.cargo/bin
release_bin: LiveSplit One.exe

- label: Tauri on Linux
platform: tauri
Expand All @@ -42,6 +45,7 @@ jobs:
target: x86_64-unknown-linux-musl
binaryen: x86_64-linux
cargo_bin: /home/runner/.cargo/bin
release_bin: LiveSplit One

- label: Tauri on macOS ARM
platform: tauri
Expand All @@ -50,6 +54,7 @@ jobs:
target: aarch64-apple-darwin
binaryen: arm64-macos
cargo_bin: /Users/runner/.cargo/bin
release_bin: LiveSplit One

steps:
- name: Checkout commit
Expand Down Expand Up @@ -195,3 +200,20 @@ jobs:
publish_branch: gh-pages
publish_dir: ./${{ matrix.dist_path }}
force_orphan: true

- name: Prepare Release (Tauri)
if: matrix.platform == 'tauri'
shell: bash
run: .github/workflows/build_zip.sh
env:
OS_NAME: ${{ matrix.os }}
TARGET: ${{ matrix.binaryen }}

- name: Release (Tauri)
if: matrix.platform == 'tauri'
uses: softprops/action-gh-release@v2
with:
files: LiveSplitOne-*.*
name: Latest
tag_name: latest
body: The latest desktop version of LiveSplit One, which has support for global hotkeys.

0 comments on commit e751454

Please sign in to comment.