|
66 | 66 | - name: Install frontend dependencies |
67 | 67 | run: npm ci |
68 | 68 |
|
| 69 | + - name: Resolve release version |
| 70 | + id: release-version |
| 71 | + shell: bash |
| 72 | + run: | |
| 73 | + version=$(node -p "require('./package.json').version") |
| 74 | + echo "version=${version}" >> "$GITHUB_OUTPUT" |
| 75 | +
|
69 | 76 | - name: Windows smoke check |
70 | 77 | if: matrix.platform == 'windows-latest' |
71 | 78 | run: cargo check --manifest-path src-tauri/Cargo.toml |
@@ -133,6 +140,55 @@ jobs: |
133 | 140 | updaterJsonKeepUniversal: true |
134 | 141 | args: --target ${{ matrix.target }} |
135 | 142 |
|
| 143 | + - name: Build CLI release binary |
| 144 | + shell: bash |
| 145 | + run: | |
| 146 | + set -euo pipefail |
| 147 | +
|
| 148 | + target="${{ matrix.target }}" |
| 149 | + dist_dir="cli-dist" |
| 150 | + binary_path="src-tauri/target/${target}/release/skills-manager-plus-cli" |
| 151 | +
|
| 152 | + cargo build --manifest-path src-tauri/Cargo.toml --release --target "${target}" --bin skills-manager-plus-cli |
| 153 | +
|
| 154 | + mkdir -p "${dist_dir}" |
| 155 | + case "${target}" in |
| 156 | + aarch64-apple-darwin) |
| 157 | + asset_name="smp-macos-arm64" |
| 158 | + ;; |
| 159 | + x86_64-apple-darwin) |
| 160 | + asset_name="smp-macos-x64" |
| 161 | + ;; |
| 162 | + x86_64-unknown-linux-gnu) |
| 163 | + asset_name="smp-linux-x64" |
| 164 | + ;; |
| 165 | + x86_64-pc-windows-msvc) |
| 166 | + asset_name="smp-windows-x64.exe" |
| 167 | + ;; |
| 168 | + *) |
| 169 | + echo "Unsupported CLI release target: ${target}" |
| 170 | + exit 1 |
| 171 | + ;; |
| 172 | + esac |
| 173 | +
|
| 174 | + artifact_path="${dist_dir}/${asset_name}" |
| 175 | + if [[ "${target}" == "x86_64-pc-windows-msvc" ]]; then |
| 176 | + cp "${binary_path}.exe" "${artifact_path}" |
| 177 | + else |
| 178 | + cp "${binary_path}" "${artifact_path}" |
| 179 | + chmod +x "${artifact_path}" |
| 180 | + fi |
| 181 | +
|
| 182 | + node -e "const fs=require('fs'); const crypto=require('crypto'); const path=require('path'); const file=process.argv[1]; const hash=crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex'); fs.writeFileSync(file + '.sha256', hash + ' ' + path.basename(file) + '\n');" "${artifact_path}" |
| 183 | +
|
| 184 | + - name: Upload CLI binary to release |
| 185 | + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' |
| 186 | + shell: bash |
| 187 | + env: |
| 188 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 189 | + run: | |
| 190 | + gh release upload "v${{ steps.release-version.outputs.version }}" cli-dist/smp-* --clobber |
| 191 | +
|
136 | 192 | verify-updater-assets: |
137 | 193 | needs: build |
138 | 194 | if: startsWith(github.ref, 'refs/tags/') |
|
0 commit comments