Skip to content

Commit

Permalink
update tauri-publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
k2d222 committed Oct 20, 2024
1 parent baba805 commit b7ef297
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/tauri-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin"
target: "aarch64-apple-darwin"
name: "macos-aarch64"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
target: "x86_64-apple-darwin"
name: "macos-x64"
- platform: "ubuntu-latest" # for Tauri v1 you could replace this with ubuntu-20.04.
args: ""
name: "linux-ubuntu"
- platform: "twwe-server-windows-latest"
args: ""
target: "x86_64-unknown-linux-gnu"
name: "linux-x64"
- platform: "windows-latest"
target: "x86_64-pc-windows-msvc"
name: "windows-x64"
runs-on: ${{ matrix.platform }}

Expand All @@ -38,7 +38,7 @@ jobs:
node-version: lts/*

- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('client/package.json').version")" >> $GITHUB_ENV
run: echo "PACKAGE_VERSION=$(node -p "require('./client/package.json').version")" >> $GITHUB_ENV

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
with:
use-cross: true
command: build
args: server --verbose --release ${{ matrix.args }}
args: --manifest-path server/Cargo.toml --verbose --release --target ${{ matrix.target }}

- name: build static site
run: cd client && npm run build
Expand All @@ -85,14 +85,14 @@ jobs:
dirname: twwe-server_v${{ env.PACKAGE_VERSION }}_${{ matrix.name }}
run: |
mkdir "$dirname"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
mv "server/target/${{ matrix.target }}/release/twwe-server.exe" "$dirname"
else
mv "server/target/${{ matrix.target }}/release/twwe-server" "$dirname"
fi
mv "client/dist" "$dirname/static"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
7z a "$dirname.zip" "$dirname"
echo "ASSET=$dirname.zip" >> $GITHUB_ENV
else
Expand All @@ -101,10 +101,7 @@ jobs:
fi
- name: upload server to release
uses: actions/github-script@v6
env:
tag: app-v${{ env.PACKAGE_VERSION }}
file: ${{ env.ASSET }}
with:
script: |
gh release upload $tag $file
run: gh release upload $tag $file

0 comments on commit b7ef297

Please sign in to comment.