-
Notifications
You must be signed in to change notification settings - Fork 234
104 lines (94 loc) · 3.06 KB
/
release-layer-ruby.yml
File metadata and controls
104 lines (94 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: "Release Ruby Lambda Layer"
on:
# (Using tag push instead of release to allow filtering by tag prefix.)
push:
tags:
- layer-ruby/**
permissions:
contents: read
jobs:
create-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Create Release
run: gh release create ${{ github.ref_name }} --draft --title ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-layer:
permissions:
id-token: write
contents: write
attestations: write
runs-on: ubuntu-latest
needs: create-release
outputs:
RUBY_SDK_VERSION: ${{ steps.save-ruby-sdk-version.outputs.RUBY_SDK_VERSION}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Build
run: |
./build.sh
shell: bash
working-directory: ruby/src
- name: Save Ruby SDK Version
id: save-ruby-sdk-version
run: |
unzip -q build/opentelemetry-ruby-layer.zip
export GEM_PATH=$PWD/ruby/gems/3.2.0/
RUBY_SDK_VERSION=$(ruby -e 'require "opentelemetry-sdk"; puts OpenTelemetry::SDK::VERSION')
echo "RUBY_SDK_VERSION=$RUBY_SDK_VERSION" >> $GITHUB_OUTPUT
working-directory: ruby/src
- name: Show directory contents
run: |
ls -al
working-directory: ruby/src/build
- name: Generate artifact attestation for ruby-layer
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a #v3.0.0
with:
subject-path: ruby/src/build/opentelemetry-ruby-layer.zip
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
name: Save assembled layer to build
with:
name: opentelemetry-ruby-layer.zip
path: ruby/src/build/opentelemetry-ruby-layer.zip
- name: Add Binary to Release
run: |
gh release upload ${{github.ref_name}} ruby/src/build/opentelemetry-ruby-layer.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-layer:
permissions: # required by the reusable workflow
contents: read
id-token: write
uses: ./.github/workflows/layer-publish.yml
needs: build-layer
strategy:
matrix:
aws_region:
- 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
with:
artifact-name: opentelemetry-ruby-layer.zip
layer-name: opentelemetry-ruby
component-version: ${{needs.build-layer.outputs.RUBY_SDK_VERSION}}
runtimes: ruby3.2 ruby3.3
release-group: prod
aws_region: ${{ matrix.aws_region }}
secrets: inherit