ci: enable auto-generated release notes in publish workflow #17
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: publish | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| branches: [] | |
| workflow_dispatch: | |
| jobs: | |
| publish-tauri: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| - platform: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libglib2.0-dev pkg-config libgtk-3-dev javascriptcoregtk-4.1 \ | |
| libsoup-3.0 webkit2gtk-4.1 | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: ${{ runner.os }}-bun- | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| target | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - name: Install JS deps | |
| run: bun install | |
| # ---------- 构建 Tauri ---------- | |
| - name: Build Tauri app | |
| run: | | |
| bun run tauri build --target ${{ matrix.target }} | |
| # ---------- 打包 artifacts ---------- | |
| - name: Package Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| VERSION=${GITHUB_REF_NAME} | |
| mkdir -p artifacts | |
| cp src-tauri/target/${{ matrix.target }}/release/ipmesctool artifacts/ipmesctool-linux-${VERSION} | |
| - name: Package Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $VERSION = "${{ github.ref_name }}" | |
| # create artifacts folder | |
| $artifacts = "artifacts" | |
| New-Item -ItemType Directory -Force -Path $artifacts | |
| # copy exe and rename | |
| $EXE_NAME = "ipmesctool-windows-$VERSION.exe" | |
| Copy-Item -Path "src-tauri/target/${{ matrix.target }}/release/ipmesctool.exe" -Destination "$artifacts/$EXE_NAME" -Force | |
| # ---------- 上传 Release ---------- | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |