diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eb0358a9..2f2f4d2f8 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: @@ -56,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 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