|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-standalone: |
| 10 | + name: Build Standalone (${{ matrix.target }}) |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + include: |
| 14 | + - platform: ubuntu-22.04 |
| 15 | + target: x86_64-unknown-linux-gnu |
| 16 | + artifact-name: standalone-linux-x64 |
| 17 | + - platform: macos-latest |
| 18 | + target: aarch64-apple-darwin |
| 19 | + artifact-name: standalone-mac-aarch64 |
| 20 | + - platform: windows-latest |
| 21 | + target: x86_64-pc-windows-msvc |
| 22 | + artifact-name: standalone-win-x64 |
| 23 | + runs-on: ${{ matrix.platform }} |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version: 22 |
| 30 | + |
| 31 | + - uses: pnpm/action-setup@v4 |
| 32 | + with: |
| 33 | + version: 10 |
| 34 | + |
| 35 | + - name: Install workspace dependencies |
| 36 | + run: pnpm install --frozen-lockfile |
| 37 | + |
| 38 | + - uses: dtolnay/rust-toolchain@stable |
| 39 | + with: |
| 40 | + targets: ${{ matrix.target }} |
| 41 | + |
| 42 | + - name: Rust cache |
| 43 | + uses: swatinem/rust-cache@v2 |
| 44 | + with: |
| 45 | + workspaces: standalone/src-tauri |
| 46 | + |
| 47 | + - name: Install system dependencies (Linux) |
| 48 | + if: matrix.platform == 'ubuntu-22.04' |
| 49 | + run: | |
| 50 | + sudo apt-get update -qq |
| 51 | + sudo apt-get install -y -qq libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf |
| 52 | +
|
| 53 | + - name: Build Tauri app |
| 54 | + uses: tauri-apps/tauri-action@v0 |
| 55 | + env: |
| 56 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + # Dummy key so Tauri generates updater artifacts; real signing happens locally |
| 58 | + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
| 59 | + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 60 | + with: |
| 61 | + projectPath: standalone |
| 62 | + tauriScript: pnpm tauri |
| 63 | + args: --target ${{ matrix.target }} |
| 64 | + |
| 65 | + - name: List bundle contents (debug) |
| 66 | + if: matrix.target == 'x86_64-pc-windows-msvc' |
| 67 | + run: find standalone/src-tauri/target/${{ matrix.target }}/release/bundle -type f | sort |
| 68 | + shell: bash |
| 69 | + |
| 70 | + - name: Copy NSIS plugin for artifact upload (Windows) |
| 71 | + if: matrix.target == 'x86_64-pc-windows-msvc' |
| 72 | + run: | |
| 73 | + mkdir -p standalone/src-tauri/target/${{ matrix.target }}/release/nsis/x64/plugins |
| 74 | + cp "$LOCALAPPDATA/tauri/NSIS/Plugins/x86-unicode/additional/nsis_tauri_utils.dll" \ |
| 75 | + standalone/src-tauri/target/${{ matrix.target }}/release/nsis/x64/plugins/ |
| 76 | + shell: bash |
| 77 | + |
| 78 | + - name: Upload artifacts |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: ${{ matrix.artifact-name }} |
| 82 | + path: | |
| 83 | + standalone/src-tauri/target/${{ matrix.target }}/release/mouseterm.exe |
| 84 | + standalone/src-tauri/target/${{ matrix.target }}/release/bundle/**/*.exe |
| 85 | + standalone/src-tauri/target/${{ matrix.target }}/release/bundle/**/*.msi |
| 86 | + standalone/src-tauri/target/${{ matrix.target }}/release/bundle/**/*.dmg |
| 87 | + standalone/src-tauri/target/${{ matrix.target }}/release/bundle/**/*.app |
| 88 | + standalone/src-tauri/target/${{ matrix.target }}/release/bundle/**/*.AppImage |
| 89 | + standalone/src-tauri/target/${{ matrix.target }}/release/bundle/nsis/** |
| 90 | + standalone/src-tauri/target/${{ matrix.target }}/release/nsis/** |
| 91 | + standalone/sidecar/** |
| 92 | + standalone/src-tauri/binaries/** |
| 93 | +
|
| 94 | + build-vscode: |
| 95 | + name: Build VSCode Extension |
| 96 | + runs-on: ubuntu-latest |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@v4 |
| 99 | + |
| 100 | + - uses: actions/setup-node@v4 |
| 101 | + with: |
| 102 | + node-version: 22 |
| 103 | + |
| 104 | + - uses: pnpm/action-setup@v4 |
| 105 | + with: |
| 106 | + version: 10 |
| 107 | + |
| 108 | + - name: Install workspace dependencies |
| 109 | + run: pnpm install --frozen-lockfile |
| 110 | + |
| 111 | + - name: Test lib |
| 112 | + run: pnpm --filter mouseterm-lib test |
| 113 | + |
| 114 | + - name: Build frontend for VSCode |
| 115 | + run: pnpm --filter mouseterm build:frontend |
| 116 | + |
| 117 | + - name: Build extension |
| 118 | + run: pnpm --filter mouseterm build |
| 119 | + |
| 120 | + - name: Package extension |
| 121 | + run: cd vscode-ext && npx vsce package --no-dependencies |
| 122 | + |
| 123 | + - name: Upload .vsix |
| 124 | + uses: actions/upload-artifact@v4 |
| 125 | + with: |
| 126 | + name: vscode-extension |
| 127 | + path: vscode-ext/*.vsix |
| 128 | + |
| 129 | + publish-vscode: |
| 130 | + name: Publish VSCode Extension |
| 131 | + needs: |
| 132 | + - build-standalone |
| 133 | + - build-vscode |
| 134 | + runs-on: ubuntu-latest |
| 135 | + steps: |
| 136 | + - uses: actions/checkout@v4 |
| 137 | + |
| 138 | + - uses: actions/setup-node@v4 |
| 139 | + with: |
| 140 | + node-version: 22 |
| 141 | + |
| 142 | + - uses: pnpm/action-setup@v4 |
| 143 | + with: |
| 144 | + version: 10 |
| 145 | + |
| 146 | + - name: Install workspace dependencies |
| 147 | + run: pnpm install --frozen-lockfile |
| 148 | + |
| 149 | + - name: Download .vsix |
| 150 | + uses: actions/download-artifact@v4 |
| 151 | + with: |
| 152 | + name: vscode-extension |
| 153 | + path: vscode-ext |
| 154 | + |
| 155 | + - name: Publish to VS Code Marketplace |
| 156 | + working-directory: vscode-ext |
| 157 | + run: | |
| 158 | + for i in 1 2 3; do |
| 159 | + npx vsce publish --packagePath *.vsix --no-dependencies && exit 0 |
| 160 | + echo "Attempt $i failed, retrying in 10s..." |
| 161 | + sleep 10 |
| 162 | + done |
| 163 | + exit 1 |
| 164 | + env: |
| 165 | + VSCE_PAT: ${{ secrets.VSCE_PAT }} |
| 166 | + |
| 167 | + - name: Publish to OpenVSX |
| 168 | + working-directory: vscode-ext |
| 169 | + run: | |
| 170 | + for i in 1 2 3; do |
| 171 | + npx ovsx publish --packagePath *.vsix --no-dependencies && exit 0 |
| 172 | + echo "Attempt $i failed, retrying in 10s..." |
| 173 | + sleep 10 |
| 174 | + done |
| 175 | + exit 1 |
| 176 | + env: |
| 177 | + OVSX_PAT: ${{ secrets.OVSX_PAT }} |
0 commit comments