diff --git a/.github/matrix_includes_packchk.json b/.github/matrix_includes_packchk.json index 7c8894f62..689f8f8af 100644 --- a/.github/matrix_includes_packchk.json +++ b/.github/matrix_includes_packchk.json @@ -3,36 +3,42 @@ "runs_on":"macos-13", "target":"darwin", "arch": "amd64", - "runOn": "publicRepo" + "runOn": "publicRepo", + "binary": "packchk" }, { "runs_on":"macos-14", "target":"darwin", "arch": "arm64", - "runOn": "publicRepo" + "runOn": "publicRepo", + "binary": "packchk" }, { "runs_on":"ubuntu-22.04", "target":"linux", "arch": "amd64", - "runOn": "always" + "runOn": "always", + "binary": "packchk" }, { "runs_on":"ubuntu-22.04", "target":"linux", "arch": "arm64", - "runOn": "always" + "runOn": "always", + "binary": "packchk" }, { "runs_on":"windows-2019", "target":"windows", "arch": "amd64", - "runOn": "always" + "runOn": "always", + "binary": "packchk.exe" }, { "runs_on":"windows-2019", "target":"windows", "arch": "arm64", - "runOn": "always" + "runOn": "always", + "binary": "packchk.exe" } ] diff --git a/.github/matrix_includes_svdconv.json b/.github/matrix_includes_svdconv.json index 7c8894f62..44c835511 100644 --- a/.github/matrix_includes_svdconv.json +++ b/.github/matrix_includes_svdconv.json @@ -3,36 +3,42 @@ "runs_on":"macos-13", "target":"darwin", "arch": "amd64", - "runOn": "publicRepo" + "runOn": "publicRepo", + "binary": "svdconv" }, { "runs_on":"macos-14", "target":"darwin", "arch": "arm64", - "runOn": "publicRepo" + "runOn": "publicRepo", + "binary": "svdconv" }, { "runs_on":"ubuntu-22.04", "target":"linux", "arch": "amd64", - "runOn": "always" + "runOn": "always", + "binary": "svdconv" }, { "runs_on":"ubuntu-22.04", "target":"linux", "arch": "arm64", - "runOn": "always" + "runOn": "always", + "binary": "svdconv" }, { "runs_on":"windows-2019", "target":"windows", "arch": "amd64", - "runOn": "always" + "runOn": "always", + "binary": "svdconv.exe" }, { "runs_on":"windows-2019", "target":"windows", "arch": "arm64", - "runOn": "always" + "runOn": "always", + "binary": "svdconv.exe" } ] diff --git a/.github/workflows/buildmgr.yml b/.github/workflows/buildmgr.yml index bd09cf903..57cb0bbec 100644 --- a/.github/workflows/buildmgr.yml +++ b/.github/workflows/buildmgr.yml @@ -82,6 +82,15 @@ jobs: target: cbuildgen arch: ${{ matrix.arch }} + - name: Strip projmgr release binary + if: | + github.event_name == 'release' && + (startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu')) + run: | + binary_path="./build/tools/buildmgr/cbuildgen/${{ matrix.target }}-${{ matrix.arch }}/Release/cbuildgen${{ matrix.binary_extension }}" + echo "Stripping binary at: $binary_path" + strip "$binary_path" + - name: Archive cbuildgen uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: diff --git a/.github/workflows/packchk.yml b/.github/workflows/packchk.yml index baf7c6110..c60970d84 100644 --- a/.github/workflows/packchk.yml +++ b/.github/workflows/packchk.yml @@ -88,6 +88,48 @@ jobs: retention-days: ${{ needs.setup.outputs.retention_days }} if-no-files-found: error + - name: Install strip tools + if: | + github.event_name == 'release' && + matrix.arch == 'arm64' && + startsWith(matrix.runs_on, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install binutils-aarch64-linux-gnu + + # Run only for release events on macOS or Ubuntu runners + - name: Strip and bundle packchk release binary + if: | + github.event_name == 'release' && + (startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu')) + shell: bash + working-directory: build/tools/packchk/ + run: | + mkdir -p packchk_release_bin + + # Extract the binary tarball into the release directory + tar -xvf packchk-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2 -C packchk_release_bin + + # Construct the path to the extracted binary + binary_path="./packchk_release_bin/${{ matrix.binary }}" + echo "Stripping binary at: $binary_path" + + # Use appropriate strip tool based on architecture and target + if [[ "${{ matrix.arch }}" == "arm64" && "${{ matrix.target }}" == "linux" ]]; then + aarch64-linux-gnu-strip "$binary_path" + else + strip "$binary_path" + fi + + # Temporarily rename the original archive + original_filename=$(find . -maxdepth 1 -type f -name "packchk-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2" | head -n 1) + mv "$original_filename" ./temp.tbz2 + + # Repack the modified binary into a new tarball + output_name=$(basename "$original_filename") + echo "Repacking into: $output_name" + tar -cjf "$output_name" -C packchk_release_bin . + - name: Attach zipped binary to the release if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 @@ -185,8 +227,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install \ - lcov + sudo apt-get install lcov - name: Checkout devtools uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/packgen.yml b/.github/workflows/packgen.yml index c05588407..27d9dbc0d 100644 --- a/.github/workflows/packgen.yml +++ b/.github/workflows/packgen.yml @@ -75,6 +75,15 @@ jobs: target: packgen arch: ${{ matrix.arch }} + - name: Strip packgen release binary + if: | + github.event_name == 'release' && + (startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu')) + run: | + binary_path="./build/tools/packgen/${{ matrix.target }}-${{ matrix.arch }}/Release/${{ matrix.binary }}" + echo "Stripping binary at: $binary_path" + strip "$binary_path" + - name: Archive packgen uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: diff --git a/.github/workflows/projmgr.yml b/.github/workflows/projmgr.yml index 5c8bb51fb..129cd8166 100644 --- a/.github/workflows/projmgr.yml +++ b/.github/workflows/projmgr.yml @@ -80,6 +80,15 @@ jobs: target: projmgr arch: ${{ matrix.arch }} + - name: Strip projmgr release binary + if: | + github.event_name == 'release' && + (startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu')) + run: | + binary_path="./build/tools/projmgr/${{ matrix.target }}-${{ matrix.arch }}/Release/${{ matrix.binary }}" + echo "Stripping binary at: $binary_path" + strip "$binary_path" + - name: Archive projmgr uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: diff --git a/.github/workflows/svdconv.yml b/.github/workflows/svdconv.yml index ea87f1220..e7259977d 100644 --- a/.github/workflows/svdconv.yml +++ b/.github/workflows/svdconv.yml @@ -79,6 +79,47 @@ jobs: retention-days: ${{ needs.setup.outputs.retention_days }} if-no-files-found: error + - name: Install strip tools + if: | + github.event_name == 'release' && + matrix.arch == 'arm64' && + startsWith(matrix.runs_on, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install binutils-aarch64-linux-gnu + + # Run only for release events on macOS or Ubuntu runners + - name: Strip and bundle svdconv release binary + if: | + github.event_name == 'release' && + (startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu')) + working-directory: build/tools/svdconv/SVDConv + run: | + mkdir -p svdconv_release_bin + + # Extract the binary tarball into the release directory + tar -xvf svdconv-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2 -C svdconv_release_bin + + # Construct the path to the extracted binary + binary_path="./svdconv_release_bin/${{ matrix.binary }}" + echo "Stripping binary at: $binary_path" + + # Use appropriate strip tool based on architecture and target + if [[ "${{ matrix.arch }}" == "arm64" && "${{ matrix.target }}" == "linux" ]]; then + aarch64-linux-gnu-strip "$binary_path" + else + strip "$binary_path" + fi + + # Temporarily rename the original archive + original_filename=$(find . -maxdepth 1 -type f -name "svdconv-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2" | head -n 1) + mv "$original_filename" ./temp.tbz2 + + # Repack the modified binary into a new tarball + output_name=$(basename "$original_filename") + echo "Repacking into: $output_name" + tar -cjf "$output_name" -C svdconv_release_bin . + - name: Attach svdconv binary to release if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2