From 7586f72929f7c89e4b9d84fe3f4eca688e166528 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 4 Jul 2024 03:21:37 +0700 Subject: [PATCH 1/2] ci: custom runner option for custom build workflow call --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6d79000df..d3e4956962 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,16 @@ on: packages: description: "Packages to Build" required: true + custom_builder: + description: "Custom Builder" + required: false + default: "" jobs: parse: outputs: pkgs: ${{ steps.parsing.outputs.pkgs }} + builder: ${{ inputs.custom_builder }} runs-on: "ubuntu-latest" steps: - name: Parse Input @@ -22,9 +27,9 @@ jobs: matrix: pkg: ${{ fromJson(needs.parse.outputs.pkgs) }} version: ["40"] - arch: ["x86_64", "aarch64"] + arch: ${{ output.builder == "x86-64-lg" && ["x86_64"] || ["x86_64", "aarch64"] }} fail-fast: false - runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }} + runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || output.builder && output.builder || 'ubuntu-latest' }} container: image: ghcr.io/terrapkg/builder:f${{ matrix.version }} options: --cap-add=SYS_ADMIN --privileged From 021048584dbcf236dce9b212e9c64905cb6eaff5 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 7 Jul 2024 14:32:50 +0700 Subject: [PATCH 2/2] fix: outputs --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3e4956962..d99db32d94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,9 @@ jobs: steps: - name: Parse Input id: parsing - run: echo "${{ inputs.packages }}" | sed 's/ /\n/g' | sed 's/$/\//g' | jq -R . | jq -s . | jq -c . | sed 's/^/pkgs=/' >> $GITHUB_OUTPUT + run: | + echo "${{ inputs.packages }}" | sed 's/ /\n/g' | sed 's/$/\//g' | jq -R . | jq -s . | jq -c . | sed 's/^/pkgs=/' >> $GITHUB_OUTPUT + echo "builder=${{ inputs.custom_builder }}" >> $GITHUB_OUTPUT build: needs: parse @@ -27,9 +29,9 @@ jobs: matrix: pkg: ${{ fromJson(needs.parse.outputs.pkgs) }} version: ["40"] - arch: ${{ output.builder == "x86-64-lg" && ["x86_64"] || ["x86_64", "aarch64"] }} + arch: ${{ needs.parse.outputs.builder == "x86-64-lg" && ["x86_64"] || ["x86_64", "aarch64"] }} fail-fast: false - runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || output.builder && output.builder || 'ubuntu-latest' }} + runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || needs.parse.outputs.builder && needs.parse.outputs.builder || 'ubuntu-latest' }} container: image: ghcr.io/terrapkg/builder:f${{ matrix.version }} options: --cap-add=SYS_ADMIN --privileged