Skip to content

Commit

Permalink
Update Ruby workflow (newrelic#243)
Browse files Browse the repository at this point in the history
* update ruby workflow
  • Loading branch information
chaudharysaket authored May 23, 2024
1 parent 16c85cc commit c6678ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 139 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/publish-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+(\.[0-9]+)*_ruby$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Clean the workspace
run: ./bin/clean
working-directory: ruby
- name: Install Ruby Dependencies
run: bundle
working-directory: ruby
Expand All @@ -32,17 +35,10 @@ jobs:
echo "::set-output name=VERSION::$(
echo ${{ matrix.ruby-version }} | sed 's/\.//'
)"
- name: Publish layer
- name: Build and Publish layer
if: steps.ruby-check-tag.outputs.match == 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: make publish-ruby${{ steps.ruby-version-without-dot.outputs.VERSION }}-ci
- name: Publish ECR image for ruby ${{ matrix.ruby-version }}
if: steps.ruby-check-tag.outputs.match == 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd ruby
./publish-ecr-images.sh ruby${{ matrix.ruby-version }}
run: ./publish-layers.sh ruby${{ matrix.ruby-version }}
working-directory: ruby
125 changes: 0 additions & 125 deletions ruby/publish-ecr-images.sh

This file was deleted.

12 changes: 8 additions & 4 deletions ruby/publish-layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ RB32_DIST_ARM64=$DIST_DIR/ruby32.arm64.zip
RB33_DIST_ARM64=$DIST_DIR/ruby33.arm64.zip

# Distribution paths for X86_64
RB32_DIST_X64_64=$DIST_DIR/ruby32.x86_64.zip
RB33_DIST_X64_64=$DIST_DIR/ruby33.x86_64.zip
RB32_DIST_X86_64=$DIST_DIR/ruby32.x86_64.zip
RB33_DIST_X86_64=$DIST_DIR/ruby33.x86_64.zip

source ../libBuild.sh

Expand All @@ -46,7 +46,7 @@ function build-ruby33-arm64 {
}

function build-ruby32-x86 {
build_ruby_for_arch 3.2 'x86_64' $RB32_DIST_X64_64
build_ruby_for_arch 3.2 'x86_64' $RB32_DIST_X86_64
}

function build-ruby33-x86 {
Expand All @@ -58,7 +58,7 @@ function publish-ruby32-arm64 {
}

function publish-ruby33-arm64 {
publush_ruby_for_arch 3.3 'arm64' $RB33_DIST_ARM64
publish_ruby_for_arch 3.3 'arm64' $RB33_DIST_ARM64
}

function publish-ruby32-x86 {
Expand Down Expand Up @@ -156,14 +156,18 @@ case "$1" in
"ruby3.3")
build-ruby33-arm64
publish-ruby33-arm64
publish_docker_ecr $RB33_DIST_ARM64 ruby3.3 arm64
build-ruby33-x86
publish-ruby33-x86
publish_docker_ecr $RB33_DIST_X86_64 ruby3.3 x86_64
;;
"ruby3.2")
build-ruby32-arm64
publish-ruby32-arm64
publish_docker_ecr $RB32_DIST_ARM64 ruby3.2 arm64
build-ruby32-x86
publish-ruby32-x86
publish_docker_ecr $RB32_DIST_X86_64 ruby3.2 x86_64
;;
*)
usage
Expand Down

0 comments on commit c6678ae

Please sign in to comment.