🎨 Modify the workflow name

This commit is contained in:
Tw93
2025-08-21 20:31:38 +08:00
parent d37738c032
commit 65cf0d272b
2 changed files with 19 additions and 31 deletions

View File

@@ -42,10 +42,11 @@ on:
default: "https://twitter.com/" default: "https://twitter.com/"
jobs: jobs:
build_single_app: build:
name: ${{ inputs.title }} (${{ matrix.os }}) name: ${{ inputs.title }} (${{ matrix.os }})
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false
matrix: matrix:
build: [linux, macos, windows] build: [linux, macos, windows]
include: include:
@@ -77,16 +78,6 @@ jobs:
node-version: 22 node-version: 22
cache: "npm" cache: "npm"
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-deps-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-deps-
- name: Install dependencies (ubuntu only) - name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@v1.4.3 uses: awalsh128/cache-apt-pkgs-action@v1.4.3
@@ -95,8 +86,8 @@ jobs:
version: 1.1 version: 1.1
- name: Rust cache restore - name: Rust cache restore
id: cache_store
uses: actions/cache/restore@v4.2.0 uses: actions/cache/restore@v4.2.0
id: cache_store
with: with:
path: | path: |
~/.cargo/bin/ ~/.cargo/bin/
@@ -104,7 +95,7 @@ jobs:
~/.cargo/registry/cache/ ~/.cargo/registry/cache/
~/.cargo/git/db/ ~/.cargo/git/db/
src-tauri/target/ src-tauri/target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Config App - name: Config App
env: env:
@@ -116,7 +107,13 @@ jobs:
npm ci npm ci
npm run build:config npm run build:config
- name: Build for Ubuntu - name: Add Rust targets for macOS universal build
if: matrix.os == 'macos-latest'
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
- name: Build for Linux
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
timeout-minutes: 15 timeout-minutes: 15
run: | run: |
@@ -125,12 +122,6 @@ jobs:
mv src-tauri/target/release/bundle/deb/*.deb output/linux/${{inputs.title}}_`arch`.deb mv src-tauri/target/release/bundle/deb/*.deb output/linux/${{inputs.title}}_`arch`.deb
mv src-tauri/target/release/bundle/appimage/*.AppImage output/linux/"${{inputs.title}}"_`arch`.AppImage mv src-tauri/target/release/bundle/appimage/*.AppImage output/linux/"${{inputs.title}}"_`arch`.AppImage
- name: Add Rust targets for macOS universal build
if: matrix.os == 'macos-latest'
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
- name: Build for macOS - name: Build for macOS
if: matrix.os == 'macos-latest' if: matrix.os == 'macos-latest'
timeout-minutes: 20 timeout-minutes: 20
@@ -146,14 +137,11 @@ jobs:
npm run tauri build -- --target x86_64-pc-windows-msvc npm run tauri build -- --target x86_64-pc-windows-msvc
New-Item -Path "output\windows" -ItemType Directory New-Item -Path "output\windows" -ItemType Directory
Move-Item -Path "src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\*.msi" -Destination "output\windows\${{inputs.title}}_x64.msi" Move-Item -Path "src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\*.msi" -Destination "output\windows\${{inputs.title}}_x64.msi"
- name: Restore Cargo Lock File(Windows Only)
if: matrix.os == 'windows-latest'
run: |
git checkout -- src-tauri/Cargo.lock git checkout -- src-tauri/Cargo.lock
- name: Rust cache store - name: Rust cache store
uses: actions/cache/save@v4.2.0 uses: actions/cache/save@v4.2.0
if: steps.cache_store.outputs.cache-hit != 'true'
with: with:
path: | path: |
~/.cargo/bin/ ~/.cargo/bin/
@@ -161,18 +149,18 @@ jobs:
~/.cargo/registry/cache/ ~/.cargo/registry/cache/
~/.cargo/git/db/ ~/.cargo/git/db/
src-tauri/target/ src-tauri/target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Upload For Single Build - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/') != true
with: with:
path: "output/*/*.*" name: ${{ inputs.title }}-${{ matrix.build }}
path: output/*/*.*
retention-days: 3
- name: Upload For Release - name: Upload to release
# arg info: https://github.com/ncipollo/release-action#release-action
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/') == true if: startsWith(github.ref, 'refs/tags/')
with: with:
allowUpdates: true allowUpdates: true
artifacts: "output/*/*.*" artifacts: "output/*/*.*"