From 171dc9d79174a6cb474d87cbcf07713f22a727f4 Mon Sep 17 00:00:00 2001 From: "fr4nc1sc0.r4m0n" Date: Tue, 12 Aug 2025 13:10:53 +0200 Subject: [PATCH 1/2] Add flag to skip build-distrubution execution step when triggered from a release tag event --- .github/workflows/release.yml | 16 ++++++++++++++++ .github/workflows/test-release.yml | 11 +++++++++++ .github/workflows/test.yml | 11 +++++++++++ 3 files changed, 38 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eb0358a9..3cb08a632 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,11 +11,27 @@ permissions: contents: read jobs: + build-distribution: + permissions: + attestations: write + id-token: write + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-distribution + - name: generate build provenance + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 + with: + subject-path: "${{ github.workspace }}/build/dist/elastic-apm-python-lambda-layer.zip" + test: uses: ./.github/workflows/test-release.yml + needs: build-distribution with: full-matrix: true enabled: ${{ startsWith(github.ref, 'refs/tags') }} + skip-build: true packages: permissions: diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index c873f9eb7..43812eb94 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -15,6 +15,11 @@ on: description: "Whether to run the workfow" required: true type: boolean + skip-build: + description: "Skip the build distribution step" + required: false + type: boolean + default: false workflow_dispatch: inputs: full-matrix: @@ -25,6 +30,11 @@ on: description: "Whether to run the workfow" required: true type: boolean + skip-build: + description: "Skip the build distribution step" + required: false + type: boolean + default: false jobs: test: @@ -32,6 +42,7 @@ jobs: uses: ./.github/workflows/test.yml with: full-matrix: ${{ inputs.full-matrix }} + skip-build: ${{ inputs.skip-build }} run-if-disabled: if: ${{ ! inputs.enabled }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8de3c2414..a7d25aa1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,11 @@ on: description: "The git ref of elastic/apm-agent-python to run test workflow from." required: false type: string + skip-build: + description: "Skip the build distribution step" + required: false + type: boolean + default: false pull_request: paths-ignore: - "**/*.md" @@ -29,12 +34,18 @@ on: description: "Run the full matrix" required: true type: boolean + skip-build: + description: "Skip the build distribution step" + required: false + type: boolean + default: false permissions: contents: read jobs: build-distribution: + if: ${{ !inputs.skip-build }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 085782013bf152a02c26417073e0deab26d15b66 Mon Sep 17 00:00:00 2001 From: "fr4nc1sc0.r4m0n" Date: Tue, 12 Aug 2025 13:20:57 +0200 Subject: [PATCH 2/2] Remove previous build-distribution step from release.yml --- .github/workflows/release.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3cb08a632..2f2f4d2f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,20 +72,6 @@ jobs: with: repository-url: https://test.pypi.org/legacy/ - build-distribution: - permissions: - attestations: write - id-token: write - contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-distribution - - name: generate build provenance - uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 - with: - subject-path: "${{ github.workspace }}/build/dist/elastic-apm-python-lambda-layer.zip" - publish-lambda-layers: permissions: contents: read