Skip to content

Commit

Permalink
Automatically release Tauri binaries (#951)
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 authored Jul 21, 2024
1 parent da502a6 commit 75f5844
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build_zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set -ex

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

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

cp "src-tauri/target/release/LiveSplit One.exe" "$stage/LiveSplit One.exe" 2>/dev/null || :
cp "src-tauri/target/release/LiveSplit One" "$stage/LiveSplit One" 2>/dev/null || :
cp "src-tauri/target/release/live-split-one" "$stage/livesplit-one" 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
19 changes: 19 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 Down Expand Up @@ -195,3 +197,20 @@ jobs:
publish_branch: gh-pages
publish_dir: ./${{ matrix.dist_path }}
force_orphan: true

- name: Prepare Release (Tauri)
if: matrix.platform == 'tauri' && github.repository == 'LiveSplit/LiveSplitOne' && github.ref == 'refs/heads/master'
shell: bash
run: .github/workflows/build_zip.sh
env:
OS_NAME: ${{ matrix.os }}
TARGET: ${{ matrix.binaryen }}

- name: Release (Tauri)
if: matrix.platform == 'tauri' && github.repository == 'LiveSplit/LiveSplitOne' && github.ref == 'refs/heads/master'
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 75f5844

Please sign in to comment.