Skip to content

Commit 1728499

Browse files
committed
feat: add workflow for Ruby community agent releases
1 parent 0f0c969 commit 1728499

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
ECR_REPO: public.ecr.aws/odigos/agents/ruby-community
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v6
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Configure AWS credentials
29+
uses: aws-actions/configure-aws-credentials@v4
30+
with:
31+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-ecr-upload
32+
aws-region: 'us-east-1'
33+
34+
- name: Log in to Amazon ECR
35+
run: |
36+
aws ecr-public get-login-password --region us-east-1 \
37+
| docker login --username AWS --password-stdin public.ecr.aws
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
platforms: linux/amd64,linux/arm64
44+
file: release.Dockerfile
45+
push: true
46+
build-args: AGENT_VERSION=${{ github.ref_name }}
47+
tags: ${{ env.ECR_REPO }}:${{ github.ref_name }},${{ env.ECR_REPO }}:latest
48+
49+
- name: Notify Slack
50+
uses: odigos-io/ci-core/.github/actions/slack-release-notification@main
51+
with:
52+
webhook-url: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
53+
success-description: "Published a new release of OpenTelemetry Ruby Community Agent"
54+
failure-description: "ERROR: Failed to publish a new release of OpenTelemetry Ruby Community Agent"
55+
tag: ${{ github.ref_name }}
56+

release.Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM --platform=$BUILDPLATFORM alpine AS ruby-community-build
2+
WORKDIR /opentelemetry-ruby
3+
ARG TARGETARCH
4+
ARG RUBY_VERSIONS="3.1 3.2 3.3 3.4"
5+
ENV RUBY_VERSIONS=${RUBY_VERSIONS}
6+
COPY . .
7+
8+
# create a directory for the instrumentations and put each ruby version in it
9+
RUN mkdir -p /instrumentations/ruby
10+
11+
# Move the pre-compiled binaries for the target architecture to the final location
12+
RUN for v in ${RUBY_VERSIONS}; do \
13+
mkdir -p /instrumentations/ruby/$v; \
14+
mv ./$v/${TARGETARCH}/* /instrumentations/ruby/$v/; \
15+
done
16+
17+
FROM scratch
18+
WORKDIR /instrumentations
19+
20+
COPY --from=ruby-community-build /instrumentations .

0 commit comments

Comments
 (0)