Skip to content

Commit

Permalink
Merge pull request #192 from fwqaaq/release_gui
Browse files Browse the repository at this point in the history
add gui action release
  • Loading branch information
Borber authored Aug 6, 2023
2 parents c265e92 + c5fbb06 commit 09f226e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
tags:
- v*
- '!v_gui*'

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -89,7 +90,7 @@ jobs:
build-unix:
runs-on: ${{ matrix.os }}
env:
BUILD_EXTRA_FEATURES: ""
BUILD_EXTRA_FEATURES: ''
RUST_BACKTRACE: full
strategy:
matrix:
Expand Down Expand Up @@ -132,7 +133,7 @@ jobs:
build-windows:
runs-on: windows-latest
env:
RUSTFLAGS: "-C target-feature=+crt-static"
RUSTFLAGS: '-C target-feature=+crt-static'
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v3
Expand All @@ -155,4 +156,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/release/*
prerelease: ${{ contains(github.ref, '-') }}
prerelease: ${{ contains(github.ref, '-') }}
64 changes: 64 additions & 0 deletions .github/workflows/release_gui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build GUI release

permissions:
contents: write

on:
push:
tags:
- v_gui.*

jobs:
create_release:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changelog_reader.outputs.changes }}
version: ${{ steps.changelog_reader.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Get version number
run: |
VERSION=${{github.ref_name}}
echo "VERSION=${VERSION/v_gui\./}" >> $GITHUB_ENV
- name: Changelog Reader
id: changelog_reader
uses: mindsers/[email protected]
with:
path: './crates/gui/CHANGELOG.md'
version: ${{ env.VERSION }}

build_seam:
needs: create_release
strategy:
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'crates/gui/yarn.lock'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: |
cd crates/gui
yarn install --frozen-lockfile
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: 'crates/gui'
tagName: ${{ needs.create_release.outputs.version }}
releaseName: 'Seam ${{ needs.create_release.outputs.version }}'
releaseBody: '${{ needs.create_release.outputs.changes }}'
releaseDraft: false
prerelease: false
6 changes: 4 additions & 2 deletions crates/gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ async fn url(live: String, rid: String) -> Resp<Node> {
async fn main() {
tauri::Builder::default()
.setup(|app| {
let window = app.get_window("main").unwrap();
set_shadow(&window, true).expect("Unsupported platform!");
if cfg!(any(target_os = "macos", target_os = "windows")) {
let window = app.get_window("main").unwrap();
set_shadow(&window, true).expect("Unknow error in the macos or windows platform");
}
Ok(())
})
.invoke_handler(tauri::generate_handler![url])
Expand Down

0 comments on commit 09f226e

Please sign in to comment.