update matrix to build packages

This commit is contained in:
Michael Legleux
2026-04-21 13:26:53 -07:00
parent eb9da2b331
commit ed77410100
10 changed files with 197 additions and 88 deletions

View File

@@ -157,23 +157,24 @@ jobs:
id: version
uses: ./.github/actions/generate-version
package-deb:
needs: [should-run, build-test, generate-version]
uses: ./.github/workflows/reusable-package.yml
generate-packaging-matrix:
needs: should-run
if: ${{ needs.should-run.outputs.go == 'true' }}
uses: ./.github/workflows/reusable-strategy-matrix.yml
with:
pkg_type: deb
artifact_name: xrpld-ubuntu-jammy-gcc-12-amd64-release
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12@sha256:14e463a9a88060b5a1e579204525c4a6f23afdd0255446f8e4f5415ae0cedac6
mode: packaging
package-rpm:
needs: [should-run, build-test, generate-version]
package:
needs: [should-run, build-test, generate-version, generate-packaging-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-packaging-matrix.outputs.matrix) }}
uses: ./.github/workflows/reusable-package.yml
with:
pkg_type: rpm
artifact_name: xrpld-rhel-9-gcc-12-amd64-release
pkg_type: ${{ matrix.pkg_type }}
artifact_name: ${{ matrix.artifact_name }}
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12@sha256:196f97b62b8352da1b7cfa91c59d442cc4940eae89a05b547408f62cbddcb8b3
container_image: ${{ matrix.container_image }}
upload-recipe:
needs:

View File

@@ -53,20 +53,20 @@ jobs:
id: version
uses: ./.github/actions/generate-version
package-deb:
needs: [build-test, generate-version]
uses: ./.github/workflows/reusable-package.yml
generate-packaging-matrix:
if: ${{ github.repository == 'XRPLF/rippled' }}
uses: ./.github/workflows/reusable-strategy-matrix.yml
with:
pkg_type: deb
artifact_name: xrpld-ubuntu-jammy-gcc-12-amd64-release
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12@sha256:14e463a9a88060b5a1e579204525c4a6f23afdd0255446f8e4f5415ae0cedac6
mode: packaging
package-rpm:
needs: [build-test, generate-version]
package:
needs: [build-test, generate-version, generate-packaging-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-packaging-matrix.outputs.matrix) }}
uses: ./.github/workflows/reusable-package.yml
with:
pkg_type: rpm
artifact_name: xrpld-rhel-9-gcc-12-amd64-release
pkg_type: ${{ matrix.pkg_type }}
artifact_name: ${{ matrix.artifact_name }}
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12@sha256:196f97b62b8352da1b7cfa91c59d442cc4940eae89a05b547408f62cbddcb8b3
container_image: ${{ matrix.container_image }}

View File

@@ -116,20 +116,19 @@ jobs:
id: version
uses: ./.github/actions/generate-version
package-deb:
needs: [build-test, generate-version]
uses: ./.github/workflows/reusable-package.yml
generate-packaging-matrix:
uses: ./.github/workflows/reusable-strategy-matrix.yml
with:
pkg_type: deb
artifact_name: xrpld-ubuntu-jammy-gcc-12-amd64-release
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12@sha256:14e463a9a88060b5a1e579204525c4a6f23afdd0255446f8e4f5415ae0cedac6
mode: packaging
package-rpm:
needs: [build-test, generate-version]
package:
needs: [build-test, generate-version, generate-packaging-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-packaging-matrix.outputs.matrix) }}
uses: ./.github/workflows/reusable-package.yml
with:
pkg_type: rpm
artifact_name: xrpld-rhel-9-gcc-12-amd64-release
pkg_type: ${{ matrix.pkg_type }}
artifact_name: ${{ matrix.artifact_name }}
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12@sha256:196f97b62b8352da1b7cfa91c59d442cc4940eae89a05b547408f62cbddcb8b3
container_image: ${{ matrix.container_image }}

View File

@@ -62,8 +62,8 @@ jobs:
PKG_RELEASE: ${{ inputs.pkg_release }}
run: |
mkdir -p "${BUILD_DIR}/package/rpm"
sed -e "s/@xrpld_version@/${PKG_VERSION}/" \
-e "s/@pkg_release@/${PKG_RELEASE}/" \
sed -e "s|@xrpld_version@|${PKG_VERSION}|" \
-e "s|@pkg_release@|${PKG_RELEASE}|" \
package/rpm/xrpld.spec.in > "${BUILD_DIR}/package/rpm/xrpld.spec"
- name: Build package

View File

@@ -3,6 +3,11 @@ name: Generate strategy matrix
on:
workflow_call:
inputs:
mode:
description: 'What matrix to emit: "build-test" (default) or "packaging".'
required: false
type: string
default: "build-test"
os:
description: 'The operating system to use for the build ("linux", "macos", "windows").'
required: false
@@ -41,5 +46,11 @@ jobs:
id: generate
env:
GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
GENERATE_MODE: ${{ inputs.mode == 'packaging' && '--packaging --config=linux.json' || '' }}
GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} >> "${GITHUB_OUTPUT}"
run: |
if [ -n "${GENERATE_MODE}" ]; then
./generate.py ${GENERATE_MODE} >> "${GITHUB_OUTPUT}"
else
./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} >> "${GITHUB_OUTPUT}"
fi