|
4 | 4 | workflow_dispatch:
|
5 | 5 | inputs:
|
6 | 6 | architecture:
|
| 7 | + description: 'Architecture of the layer to be published' |
| 8 | + required: true |
7 | 9 | type: choice
|
8 |
| - description: Architecture |
9 | 10 | options:
|
10 | 11 | - all
|
11 | 12 | - amd64
|
12 | 13 | - arm64
|
13 | 14 | default: all
|
14 |
| - aws_region: |
| 15 | + aws-region: |
| 16 | + description: 'AWS Region(s) where layer will be published' |
| 17 | + required: true |
15 | 18 | type: choice
|
16 |
| - description: AWS Region |
17 | 19 | options:
|
18 | 20 | - all
|
19 |
| - - ap-northeast-1 |
20 |
| - - ap-northeast-2 |
21 |
| - - ap-south-1 |
22 |
| - - ap-southeast-1 |
23 |
| - - ap-southeast-2 |
24 |
| - - ca-central-1 |
25 |
| - - eu-central-1 |
26 |
| - - eu-north-1 |
27 |
| - - eu-west-1 |
28 |
| - - eu-west-2 |
29 |
| - - eu-west-3 |
30 |
| - - sa-east-1 |
31 |
| - - us-east-1 |
32 |
| - - us-east-2 |
| 21 | +# - ap-northeast-1 |
| 22 | +# - ap-northeast-2 |
| 23 | +# - ap-south-1 |
| 24 | +# - ap-southeast-1 |
| 25 | +# - ap-southeast-2 |
| 26 | +# - ca-central-1 |
| 27 | +# - eu-central-1 |
| 28 | +# - eu-north-1 |
| 29 | +# - eu-west-1 |
| 30 | +# - eu-west-2 |
| 31 | +# - eu-west-3 |
| 32 | +# - sa-east-1 |
| 33 | +# - us-east-1 |
| 34 | +# - us-east-2 |
33 | 35 | - us-west-1
|
34 | 36 | - us-west-2
|
35 | 37 | default: all
|
| 38 | + role-arn: |
| 39 | + description: 'AWS IAM Role ARN to be assumed for publishing layer' |
| 40 | + required: false |
| 41 | + type: string |
| 42 | + layer-version: |
| 43 | + description: 'Layer version to be appended into the layer name' |
| 44 | + required: false |
| 45 | + type: string |
| 46 | + build-tags: |
| 47 | + description: 'Build tags to customize collector build' |
| 48 | + required: false |
| 49 | + type: string |
36 | 50 |
|
37 | 51 | jobs:
|
38 |
| - include-jobs: |
| 52 | + prepare-build-jobs: |
39 | 53 | runs-on: ubuntu-latest
|
40 | 54 | outputs:
|
41 |
| - jobs: ${{ steps.include-jobs.outputs.jobs }} |
| 55 | + build_jobs: ${{ steps.prepare-build-jobs.outputs.build_jobs }} |
42 | 56 | steps:
|
43 |
| - - id: include-jobs |
44 |
| - name: Include jobs |
| 57 | + - id: prepare-build-jobs |
| 58 | + name: Prepare Build Jobs |
45 | 59 | run: |
|
46 | 60 | architectures=''
|
47 | 61 | if [ ${{ github.event.inputs.architecture }} == 'all' ]; then
|
48 | 62 | architectures='["amd64", "arm64"]'
|
49 | 63 | else
|
50 | 64 | architectures='["${{ github.event.inputs.architecture }}"]'
|
51 | 65 | fi
|
52 |
| - aws_regions='' |
53 |
| - if [ ${{ github.event.inputs.aws_region }} == 'all' ]; then |
54 |
| - aws_regions='["ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-north-1", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"]' |
55 |
| - else |
56 |
| - aws_regions='["${{ github.event.inputs.aws_region }}"]' |
57 |
| - fi |
58 |
| - echo "jobs={"architecture": ${architectures}, "aws_region": ${aws_regions}}" | tr -d '[:space:]' >> $GITHUB_OUTPUT |
59 |
| - build: |
60 |
| - needs: include-jobs |
| 66 | + echo "build_jobs={"architecture": ${architectures}}" | tr -d '[:space:]' >> $GITHUB_OUTPUT |
| 67 | + build-layer: |
| 68 | + needs: prepare-build-jobs |
61 | 69 | runs-on: ubuntu-latest
|
62 | 70 | strategy:
|
63 |
| - matrix: ${{ fromJSON(needs.include-jobs.outputs.jobs) }} |
64 |
| - outputs: |
65 |
| - COLLECTOR_VERSION: ${{ steps.save-collector-version.outputs.COLLECTOR_VERSION }} |
| 71 | + matrix: ${{ fromJSON(needs.prepare-build-jobs.outputs.build_jobs) }} |
66 | 72 | steps:
|
67 | 73 | - name: Checkout Repo
|
68 | 74 | uses: actions/checkout@v4
|
|
71 | 77 | with:
|
72 | 78 | go-version: '~1.21.9'
|
73 | 79 | - name: Build Collector
|
74 |
| - run: make -C collector package GOARCH=${{ matrix.architecture }} |
| 80 | + run: | |
| 81 | + if [[ -n "${{ inputs.build-tags }}" ]]; then |
| 82 | + BUILDTAGS="${{ inputs.build-tags }}" |
| 83 | + if [[ "$BUILDTAGS" != "lambdacomponents.custom"* ]]; then |
| 84 | + BUILDTAGS="lambdacomponents.custom,$BUILDTAGS" |
| 85 | + fi |
| 86 | + fi |
| 87 | + echo "Build tags: $BUILDTAGS" |
| 88 | + make -C collector package GOARCH=${{ matrix.architecture }} BUILDTAGS=$BUILDTAGS |
75 | 89 | - name: Upload Collector Artifact
|
76 | 90 | uses: actions/upload-artifact@v4
|
77 | 91 | with:
|
78 |
| - name: opentelemetry-collector-layer-${{ matrix.architecture }}-${{ matrix.aws_region }}.zip |
| 92 | + name: opentelemetry-collector-layer-${{ matrix.architecture }}.zip |
79 | 93 | path: ${{ github.workspace }}/collector/build/opentelemetry-collector-layer-${{ matrix.architecture }}.zip
|
| 94 | + prepare-release-jobs: |
| 95 | + needs: build-layer |
| 96 | + runs-on: ubuntu-latest |
| 97 | + outputs: |
| 98 | + release_jobs: ${{ steps.prepare-release-jobs.outputs.release_jobs }} |
| 99 | + steps: |
| 100 | + - id: prepare-release-jobs |
| 101 | + name: Prepare Release Jobs |
| 102 | + run: | |
| 103 | + architectures='' |
| 104 | + if [ ${{ github.event.inputs.architecture }} == 'all' ]; then |
| 105 | + architectures='["amd64", "arm64"]' |
| 106 | + else |
| 107 | + architectures='["${{ github.event.inputs.architecture }}"]' |
| 108 | + fi |
| 109 | + aws_regions='' |
| 110 | + if [ ${{ github.event.inputs.aws-region }} == 'all' ]; then |
| 111 | + aws_regions='["us-west-1", "us-west-2"]' |
| 112 | + else |
| 113 | + aws_regions='["${{ github.event.inputs.aws-region }}"]' |
| 114 | + fi |
| 115 | + echo "release_jobs={"architecture": ${architectures}, "aws_region": ${aws_regions}}" | tr -d '[:space:]' >> $GITHUB_OUTPUT |
| 116 | + release-layer: |
| 117 | + uses: ./.github/workflows/layer-publish.yml |
| 118 | + needs: prepare-release-jobs |
| 119 | + strategy: |
| 120 | + matrix: ${{ fromJSON(needs.prepare-release-jobs.outputs.release_jobs) }} |
| 121 | + with: |
| 122 | + artifact-name: opentelemetry-collector-layer-${{ matrix.architecture }}.zip |
| 123 | + layer-name: opentelemetry-collector |
| 124 | + architecture: ${{ matrix.architecture }} |
| 125 | + runtimes: "nodejs16.x nodejs18.x nodejs20.x nodejs22.x java11 java17 java21 python3.8 python3.9 python3.10 python3.11 python3.12" |
| 126 | + release-group: prod |
| 127 | + aws_region: ${{ matrix.aws_region }} |
| 128 | + role-arn: ${{ github.event.inputs.role-arn }} |
| 129 | + component-version: 'NA' |
| 130 | + layer-version: ${{ github.event.inputs.layer-version }} |
| 131 | + secrets: inherit |
0 commit comments