feat: bump to v0.6.1 with custom savedata root path, auto release #46
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: | |
| - 'v*' # 匹配所有以v开头的tag,如v1.0.0 | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| inputs: | |
| create_release: | |
| description: 'Create GitHub Release' | |
| required: true | |
| default: 'false' | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| tag_name: | |
| description: 'Release tag name (e.g.: v1.0.0)' | |
| required: false | |
| type: string | |
| jobs: | |
| build: | |
| 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' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-store | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.pnpm-store.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-msvc | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "./src-tauri -> target" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Get version | |
| id: get_version | |
| shell: bash | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version is $VERSION" | |
| # Check if should create release | |
| - name: Check if should create release | |
| id: should_release | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| echo "CREATE_RELEASE=true" >> $GITHUB_OUTPUT | |
| echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
| echo "Triggered by tag: ${{ github.ref_name }}" | |
| elif [[ "${{ github.event.inputs.create_release }}" == "true" ]]; then | |
| echo "CREATE_RELEASE=true" >> $GITHUB_OUTPUT | |
| TAG_NAME="${{ github.event.inputs.tag_name }}" | |
| if [[ -z "$TAG_NAME" ]]; then | |
| TAG_NAME="v${{ steps.get_version.outputs.VERSION }}" | |
| fi | |
| echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT | |
| echo "Manual release requested with tag: $TAG_NAME" | |
| else | |
| echo "CREATE_RELEASE=false" >> $GITHUB_OUTPUT | |
| echo "Regular build, no release will be created" | |
| fi | |
| - name: Build project | |
| env: | |
| GITHUB_ACTIONS: true | |
| run: pnpm tauri build | |
| # Regular build: Upload to Artifacts | |
| - name: Upload Executable (Artifact) | |
| if: steps.should_release.outputs.CREATE_RELEASE == 'false' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ReinaManager-${{ steps.get_version.outputs.VERSION }}-win_x64-exe | |
| path: src-tauri/target/release/ReinaManager.exe | |
| - name: Upload MSI Installer (Artifact) | |
| if: steps.should_release.outputs.CREATE_RELEASE == 'false' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ReinaManager-${{ steps.get_version.outputs.VERSION }}-win_x64-msi | |
| path: src-tauri/target/release/bundle/msi/*.msi | |
| - name: Upload NSIS Installer (Artifact) | |
| if: steps.should_release.outputs.CREATE_RELEASE == 'false' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ReinaManager-${{ steps.get_version.outputs.VERSION }}-win_x64-setup | |
| path: src-tauri/target/release/bundle/nsis/*.exe | |
| # Release build: Create GitHub Release | |
| - name: Create Release | |
| if: steps.should_release.outputs.CREATE_RELEASE == 'true' | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.should_release.outputs.TAG_NAME }} | |
| name: ReinaManager ${{ steps.should_release.outputs.TAG_NAME }} | |
| body: | | |
| ## ReinaManager ${{ steps.should_release.outputs.TAG_NAME }} | |
| ### Download Files | |
| - **License**: LICENSE file included | |
| - **Windows NSIS Installer**: ReinaManager-${{ steps.get_version.outputs.VERSION }}-win_x64-setup.exe | |
| - **Windows MSI Installer**: ReinaManager-${{ steps.get_version.outputs.VERSION }}-win_x64.msi | |
| - **Source Code**: Available as zip and tar.gz archives | |
| ### Installation | |
| 1. Download the installer file (.exe or .msi) | |
| 2. Run the installer and follow the setup wizard | |
| 3. Launch ReinaManager from Start Menu or Desktop | |
| ### What's New | |
| Please check the commit history for detailed changes. | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: | | |
| LICENSE | |
| src-tauri/target/release/bundle/nsis/*.exe | |
| src-tauri/target/release/bundle/msi/*.msi |