|
53 | 53 | args: '' |
54 | 54 | rust_targets: '' |
55 | 55 | name: linux-x86_64 |
56 | | - # Linux ARM64 |
57 | | - - platform: ubuntu-22.04-arm |
58 | | - args: '' |
59 | | - rust_targets: '' |
60 | | - name: linux-aarch64 |
61 | 56 | # Windows |
62 | 57 | - platform: windows-latest |
63 | 58 | args: '' |
@@ -118,17 +113,46 @@ jobs: |
118 | 113 | releaseId: ${{ needs.create-release.outputs.release_id }} |
119 | 114 | args: ${{ matrix.args }} |
120 | 115 |
|
121 | | - - name: Package standalone binary (Linux) |
122 | | - if: contains(matrix.name, 'linux') |
| 116 | + build-cli: |
| 117 | + needs: create-release |
| 118 | + permissions: |
| 119 | + contents: write |
| 120 | + strategy: |
| 121 | + fail-fast: false |
| 122 | + matrix: |
| 123 | + include: |
| 124 | + - platform: ubuntu-22.04 |
| 125 | + target: x86_64-unknown-linux-gnu |
| 126 | + arch: amd64 |
| 127 | + - platform: ubuntu-22.04-arm |
| 128 | + target: aarch64-unknown-linux-gnu |
| 129 | + arch: aarch64 |
| 130 | + |
| 131 | + runs-on: ${{ matrix.platform }} |
| 132 | + |
| 133 | + steps: |
| 134 | + - name: Checkout |
| 135 | + uses: actions/checkout@v4 |
| 136 | + |
| 137 | + - name: Install Rust stable |
| 138 | + uses: dtolnay/rust-toolchain@stable |
| 139 | + |
| 140 | + - name: Rust cache |
| 141 | + uses: swatinem/rust-cache@v2 |
| 142 | + with: |
| 143 | + workspaces: './src-tauri -> target' |
| 144 | + |
| 145 | + - name: Build CLI binary (no GUI dependencies) |
| 146 | + working-directory: src-tauri |
| 147 | + run: cargo build --release --no-default-features |
| 148 | + |
| 149 | + - name: Package standalone binary |
123 | 150 | run: | |
124 | | - ARCH=$([[ "${{ matrix.name }}" == *"aarch64"* ]] && echo "aarch64" || echo "amd64") |
125 | | - BINARY="src-tauri/target/release/fetch-github-hosts" |
126 | | - TAR_NAME="fetch-github-hosts_linux_${ARCH}.tar.gz" |
127 | | - tar -czf "$TAR_NAME" -C "$(dirname "$BINARY")" "$(basename "$BINARY")" |
| 151 | + TAR_NAME="fetch-github-hosts_linux_${{ matrix.arch }}.tar.gz" |
| 152 | + tar -czf "$TAR_NAME" -C "src-tauri/target/release" "fetch-github-hosts" |
128 | 153 | echo "TAR_NAME=$TAR_NAME" >> "$GITHUB_ENV" |
129 | 154 |
|
130 | | - - name: Upload standalone binary (Linux) |
131 | | - if: contains(matrix.name, 'linux') |
| 155 | + - name: Upload standalone binary |
132 | 156 | env: |
133 | 157 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
134 | 158 | run: | |
|
0 commit comments