diff --git a/.github/workflows/build_zip.sh b/.github/workflows/build_zip.sh new file mode 100755 index 00000000..272a9d6f --- /dev/null +++ b/.github/workflows/build_zip.sh @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f20cb5c..9d5df35c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ on: jobs: build: runs-on: ${{ matrix.os }} + permissions: + contents: write strategy: fail-fast: false matrix: @@ -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.