|
88 | 88 | retention-days: ${{ needs.setup.outputs.retention_days }} |
89 | 89 | if-no-files-found: error |
90 | 90 |
|
| 91 | + - name: Install strip tools |
| 92 | + if: | |
| 93 | + github.event_name == 'release' && |
| 94 | + matrix.arch == 'arm64' && |
| 95 | + startsWith(matrix.runs_on, 'ubuntu') |
| 96 | + run: | |
| 97 | + sudo apt-get update |
| 98 | + sudo apt-get install binutils-aarch64-linux-gnu |
| 99 | +
|
| 100 | + # Run only for release events on macOS or Ubuntu runners |
| 101 | + - name: Strip and bundle packchk release binary |
| 102 | + if: | |
| 103 | + github.event_name == 'release' && |
| 104 | + (startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu')) |
| 105 | + shell: bash |
| 106 | + working-directory: build/tools/packchk/ |
| 107 | + run: | |
| 108 | + mkdir -p packchk_release_bin |
| 109 | +
|
| 110 | + # Extract the binary tarball into the release directory |
| 111 | + tar -xvf packchk-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2 -C packchk_release_bin |
| 112 | +
|
| 113 | + # Construct the path to the extracted binary |
| 114 | + binary_path="./packchk_release_bin/${{ matrix.binary }}" |
| 115 | + echo "Stripping binary at: $binary_path" |
| 116 | +
|
| 117 | + # Use appropriate strip tool based on architecture and target |
| 118 | + if [[ "${{ matrix.arch }}" == "arm64" && "${{ matrix.target }}" == "linux" ]]; then |
| 119 | + aarch64-linux-gnu-strip "$binary_path" |
| 120 | + else |
| 121 | + strip "$binary_path" |
| 122 | + fi |
| 123 | +
|
| 124 | + # Temporarily rename the original archive |
| 125 | + original_filename=$(find . -maxdepth 1 -type f -name "packchk-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2" | head -n 1) |
| 126 | + mv "$original_filename" ./temp.tbz2 |
| 127 | +
|
| 128 | + # Repack the modified binary into a new tarball |
| 129 | + output_name=$(basename "$original_filename") |
| 130 | + echo "Repacking into: $output_name" |
| 131 | + tar -cjf "$output_name" -C packchk_release_bin . |
| 132 | +
|
91 | 133 | - name: Attach zipped binary to the release |
92 | 134 | if: ${{ github.event_name == 'release' }} |
93 | 135 | uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 |
@@ -185,8 +227,7 @@ jobs: |
185 | 227 | - name: Install dependencies |
186 | 228 | run: | |
187 | 229 | sudo apt-get update |
188 | | - sudo apt-get install \ |
189 | | - lcov |
| 230 | + sudo apt-get install lcov |
190 | 231 |
|
191 | 232 | - name: Checkout devtools |
192 | 233 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
|
0 commit comments