Skip to content

Create custom jar

Create custom jar #99

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@v3
with:
ref: ${{ inputs.agent-ref }}
- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
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@v3
with:
name: custom-newrelic-jar
path: |
newrelic-agent/build/newrelicJar/newrelic.jar