Release #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version' | |
| required: true | |
| default: '0.1.0' | |
| release_notes: | |
| description: 'Release notes — what changed or added' | |
| required: true | |
| default: '' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install frontend dependencies | |
| run: npm install | |
| - name: Build App (Frontend + Tauri) | |
| run: npm run tauri build -- --verbose | |
| - name: List build artifacts | |
| shell: pwsh | |
| run: | | |
| Write-Host "Checking build artifacts..." | |
| Get-ChildItem -Path "src-tauri/target/release/bundle" -Recurse | |
| - name: Package release files | |
| shell: pwsh | |
| run: | | |
| $msiFile = Get-ChildItem -Path "src-tauri/target/release/bundle/msi" -Filter "*.msi" | Select-Object -First 1 | |
| $setupFile = Get-ChildItem -Path "src-tauri/target/release/bundle/nsis" -Filter "*-setup.exe" | Select-Object -First 1 | |
| if ($msiFile) { | |
| Copy-Item $msiFile.FullName -Destination "./datasmith-windows.msi" | |
| } else { | |
| Write-Error "MSI file not found!" | |
| } | |
| if ($setupFile) { | |
| Copy-Item $setupFile.FullName -Destination "./datasmith-windows-setup.exe" | |
| } else { | |
| Write-Error "Setup EXE not found!" | |
| } | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-artifacts | |
| path: | | |
| ./datasmith-windows.msi | |
| ./datasmith-windows-setup.exe | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libssl-dev libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Install frontend dependencies | |
| run: npm install | |
| - name: Build App (Frontend + Tauri) | |
| run: npm run tauri build -- --verbose | |
| - name: List build artifacts | |
| run: | | |
| echo "Checking build artifacts..." | |
| find src-tauri/target/release/bundle -type f | |
| - name: Package release files | |
| run: | | |
| mkdir -p ./linux-release | |
| # 查找并复制AppImage | |
| APPIMAGE=$(find src-tauri/target/release/bundle/appimage -name "*.AppImage" 2>/dev/null | head -1) | |
| if [ -f "$APPIMAGE" ]; then | |
| cp "$APPIMAGE" "./linux-release/datasmith-linux.AppImage" | |
| chmod +x "./linux-release/datasmith-linux.AppImage" | |
| fi | |
| # 查找并复制deb包 | |
| DEB=$(find src-tauri/target/release/bundle/deb -name "*.deb" 2>/dev/null | head -1) | |
| if [ -f "$DEB" ]; then | |
| cp "$DEB" "./linux-release/datasmith-linux.deb" | |
| fi | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-artifacts | |
| path: ./linux-release/* | |
| release: | |
| needs: [build-windows, build-linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Windows artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-artifacts | |
| - name: Download Linux artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| tag_name: v${{ github.event.inputs.version }} | |
| name: DataSmith v${{ github.event.inputs.version }} | |
| body: | | |
| 🚀 **DataSmith Release v${{ github.event.inputs.version }}** | |
| 📝 数据库管理工具 | |
| ### 下载说明 | |
| **Windows:** | |
| - `datasmith-windows.msi`: Windows MSI 安装包 | |
| - `datasmith-windows-setup.exe`: Windows EXE 安装包 | |
| **Linux:** | |
| - `datasmith-linux.AppImage`: Linux AppImage 可执行文件 | |
| - `datasmith-linux.deb`: Debian/Ubuntu 安装包 | |
| ### 发布说明 | |
| ${{ github.event.inputs.release_notes }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| ./datasmith-windows.msi | |
| ./datasmith-windows-setup.exe | |
| ./datasmith-linux.AppImage | |
| ./datasmith-linux.deb |