Skip to content

Commit c756a6b

Browse files
committed
update version extraction for uploading layer
1 parent c2754d3 commit c756a6b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/build_publish_lambda_layer.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,17 @@ jobs:
150150
name: ruby-layer.zip
151151
path: lambda
152152

153+
- name: extract current solarwinds_apm version from Local
154+
if: ${{ github.event.inputs.solarwinds-source == 'Local' }}
155+
run: |
156+
APM_VERSION=$(ruby -r './lib/solarwinds_apm/version.rb' -e 'puts SolarWindsAPM::Version::STRING')
157+
echo "SOLARWINDS_APM_VERSION=$APM_VERSION" >> $GITHUB_ENV
158+
153159
- name: extract current solarwinds_apm version
160+
if: ${{ github.event.inputs.solarwinds-source == 'RubyGem' }}
154161
run: |
155-
APM_VERSION=$(grep "gem 'solarwinds_apm'" lambda/otel/layer/Gemfile | awk -F"'" '{print $4}')
156-
APM_VERSION="${APM_VERSION//./_}"
162+
sudo apt-get update && apt-get install -y jq curl
163+
APM_VERSION=$(curl -s https://rubygems.org/api/v1/gems/solarwinds_apm.json | jq -r .version)
157164
echo "SOLARWINDS_APM_VERSION=$APM_VERSION" >> $GITHUB_ENV
158165
159166
- name: publish lambda layer

0 commit comments

Comments
 (0)