From c8b8f0d9614987fef2b07b48ba4d5ac9ddbf9e44 Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Tue, 25 Jun 2024 20:35:43 +0200 Subject: [PATCH] [GHA] Rework `pull_request_target` workflow. --- .github/workflows/build-from-fork.yml | 75 +++++++++++++++++++++++++++ .github/workflows/build.yml | 8 +-- 2 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build-from-fork.yml diff --git a/.github/workflows/build-from-fork.yml b/.github/workflows/build-from-fork.yml new file mode 100644 index 0000000000..0fe53c239a --- /dev/null +++ b/.github/workflows/build-from-fork.yml @@ -0,0 +1,75 @@ +name: Build from fork + +on: + pull_request_target: + types: + - ready_for_review + paths: + - '**' + - '!.github/' + workflow_dispatch: + +concurrency: + group: ${{ github.head_ref || github.ref }} + +jobs: + deb: + name: 'DEB' + strategy: + max-parallel: 1 + fail-fast: true + matrix: + os: + - debian + version: + - bookworm + - bullseye + - buster + platform: + - name: amd64 + runner: ubuntu-latest + - name: arm32v7 + runner: linux-arm64-4-core-public + - name: arm64v8 + runner: linux-arm64-4-core-public + exclude: + - version: bookworm + platform: + name: amd64 + - version: bookworm + platform: + name: arm64v8 + - version: bullseye + + runs-on: ${{ matrix.platform.runner }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + path: code + + - name: Checkout reusable actions + uses: actions/checkout@v4 + with: + repository: signalwire/actions-template + ref: main + fetch-depth: 1 + path: actions + sparse-checkout: | + .github/actions/docker-build-artifacts/action.yml + sparse-checkout-cone-mode: false + + - name: Build artifacts via Docker + uses: ./actions/.github/actions/docker-build-artifacts + with: + REPO_DOMAIN: freeswitch.signalwire.com + PLATFORM: ${{ matrix.platform.name }} + DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/Dockerfile + MAINTAINER: 'Andrey Volk ' + WORKING_DIRECTORY: code + env: + REPO_USERNAME: 'SWUSERNAME' + REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3be4b2c2c..df3baa4992 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,6 @@ name: Build and Distribute on: - pull_request_target: - types: - - ready_for_review - paths: - - '**' - - '!.github/' pull_request: push: branches: @@ -29,7 +23,7 @@ jobs: run: | JSON="[]" - if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "pull_request_target" ]]; then + if [[ "${{ github.event_name }}" == "pull_request" ]]; then JSON=$(jq -n '[ { "version": "bookworm",