Skip to content

Create custom jar

Create custom jar #142

name: Create custom jar
on:
workflow_dispatch:
inputs:
agent-ref:
description: "Specify branch/tag/hash"
required: true
default: 'main'
description:
description: "A description for the custom jar that will be generated. It will appear in the summary."
required: true
jobs:
create_custom_jar:
name: Create jar
runs-on: ubuntu-20.04
env:
# we use this in env var for conditionals (secrets can't be used in conditionals)
AWS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
steps:
- name: Checkout Java agent
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4
with:
ref: ${{ inputs.agent-ref }}
- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Build agent
run: ./gradlew $GRADLE_OPTIONS jar
- name: Set summary
run: |
echo "${{ inputs.description }}" >> $GITHUB_STEP_SUMMARY
echo "This jar was built from the ref (branch/tag/hash): ${{ inputs.ref }}." >> $GITHUB_STEP_SUMMARY
- name: Capture custom jar
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # pin@v4
with:
name: custom-newrelic-jar
path: |
newrelic-agent/build/newrelicJar/newrelic.jar