Skip to content

Commit

Permalink
chore: 构建桌面安装包时指定版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
idootop committed Mar 30, 2024
1 parent 797e596 commit 71baeac
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 37 deletions.
62 changes: 29 additions & 33 deletions .github/workflows/desktop.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: Build and Release
on:
workflow_dispatch:
inputs:
release_message:
description: "版本更新说明"
type: string
required: true
default: |
发现新版本✨ 如果更新失败,请到官网下载最新版本:https://feiyu-player.xbox.work

jobs:
build:
Expand All @@ -31,7 +24,10 @@ jobs:
id: app
run: |
cd packages/feiyu && pnpm build:desktop
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
VERSION=$(node -p "require('./package.json').version")
BUILD_VERSION="-c '{\"version\":\"$VERSION\"}'"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "build-version=$BUILD_VERSION" >> $GITHUB_OUTPUT
cd ${{ github.workspace }}
- name: 上传构建产物
uses: actions/upload-artifact@v4
Expand All @@ -41,6 +37,7 @@ jobs:
if-no-files-found: error
outputs:
version: ${{ steps.app.outputs.version }}
build-version: ${{ steps.app.outputs.build-version }}

build-for-macos:
name: macOS
Expand All @@ -51,18 +48,18 @@ jobs:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
build: macos
os: macos-latest
arch: aarch64
- target: x86_64-apple-darwin
build: macos
os: macos-latest
arch: x86_64
- target: universal-apple-darwin
build: macos
os: macos-latest
arch: universal
# - target: aarch64-apple-darwin
# build: macos
# os: macos-latest
# arch: aarch64
# - target: x86_64-apple-darwin
# build: macos
# os: macos-latest
# arch: x86_64

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -85,7 +82,7 @@ jobs:
run: |
cd packages/feiyu-desktop
cargo install tauri-cli --version "^2.0.0-beta"
cargo tauri build --target ${{ matrix.target }}
cargo tauri build ${{ needs.build.outputs.build-version }} -t ${{ matrix.target }}
cd ${{ github.workspace }}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
Expand Down Expand Up @@ -117,14 +114,14 @@ jobs:
build: windows
os: windows-latest
arch: x86_64
- target: aarch64-pc-windows-msvc
build: windows
os: windows-latest
arch: aarch64
- target: i686-pc-windows-msvc
build: windows
os: windows-latest
arch: i686
# - target: aarch64-pc-windows-msvc
# build: windows
# os: windows-latest
# arch: aarch64
# - target: i686-pc-windows-msvc
# build: windows
# os: windows-latest
# arch: i686

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -147,7 +144,7 @@ jobs:
run: |
cd packages/feiyu-desktop
cargo install tauri-cli --version "^2.0.0-beta"
cargo tauri build --target ${{ matrix.target }} ${{ env.TAURI_ARGS }}
cargo tauri build ${{ needs.build.outputs.build-version }} -t ${{ matrix.target }} ${{ env.TAURI_ARGS }}
cd ${{ github.workspace }}
env:
TAURI_ARGS: ${{ matrix.arch == 'aarch64' && '--bundles nsis,updater' || '' }}
Expand Down Expand Up @@ -189,10 +186,10 @@ jobs:
build: linux
os: ubuntu-latest
arch: x86_64
- target: aarch64-unknown-linux-gnu
build: linux
os: ubuntu-latest
arch: aarch64
# - target: aarch64-unknown-linux-gnu
# build: linux
# os: ubuntu-latest
# arch: aarch64
# - target: armv7-unknown-linux-gnueabihf
# build: linux
# os: ubuntu-latest
Expand Down Expand Up @@ -268,9 +265,9 @@ jobs:
cd packages/feiyu-desktop
cargo install tauri-cli --version "^2.0.0-beta"
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
cargo tauri build --target ${{ matrix.target }}
cargo tauri build ${{ needs.build.outputs.build-version }} -t ${{ matrix.target }}
else
cargo tauri build --target ${{ matrix.target }} -b deb,rpm
cargo tauri build ${{ needs.build.outputs.build-version }} -t ${{ matrix.target }} -b deb,rpm
fi
cd ${{ github.workspace }}
env:
Expand Down Expand Up @@ -341,7 +338,6 @@ jobs:
with:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ inputs.release_message }}
name: 飞鱼 v${{ needs.build.outputs.version }}
tag: v${{ needs.build.outputs.version }}
draft: true
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","tray:default","shell:allow-open","os:allow-os-type","cors-fetch:default","window:allow-close","window:allow-minimize","window:allow-toggle-maximize","window:allow-start-dragging","window:allow-is-fullscreen","window:allow-set-fullscreen"]}}
{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","tray:default","shell:allow-open","process:allow-restart","os:allow-os-type","cors-fetch:default","window:allow-close","window:allow-minimize","window:allow-toggle-maximize","window:allow-start-dragging","window:allow-is-fullscreen","window:allow-set-fullscreen"]}}
2 changes: 1 addition & 1 deletion packages/feiyu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "feiyu",
"version": "1.0.1",
"version": "2.0.0",
"type": "commonjs",
"scripts": {
"pwa": "ts-node scripts/pwa",
Expand Down
2 changes: 1 addition & 1 deletion packages/feiyu/src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const ClearCache = (props: { isMobile: boolean }) => {
const { isMobile: _ } = props;
return (
<Column width="100%" className="subscribe-title" alignItems="start">
<Text fontSize="16px" fontWeight="bo l d">
<Text fontSize="16px" fontWeight="bold">
清除缓存
</Text>

Expand Down

0 comments on commit 71baeac

Please sign in to comment.