Nightly Snapshot Build #942
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Snapshot Build | |
on: | |
schedule: | |
- cron: "21 3 * * *" | |
workflow_dispatch: | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
IMAGE_TAG: 611364707713.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-java-nightly:nightly | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- uses: gradle/wrapper-validation-action@v1 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | |
- name: Log in to AWS ECR | |
uses: docker/login-action@v2 | |
with: | |
registry: public.ecr.aws | |
- name: Build snapshot with Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build --stacktrace -PenableCoverage=true -PtestUpstreamSnapshots=true | |
env: | |
PUBLISH_USERNAME: ${{ secrets.PUBLISH_USERNAME }} | |
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.JAVA_INSTRUMENTATION_SNAPSHOT_ECR }} | |
aws-region: us-west-2 | |
- name: Login to private aws ecr | |
uses: docker/login-action@v2 | |
with: | |
registry: 611364707713.dkr.ecr.us-west-2.amazonaws.com | |
- name: Get current version | |
shell: bash | |
run: | | |
echo "ADOT_JAVA_VERSION=$(./gradlew printVersion -q -PtestUpstreamSnapshots=true )" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build image for testing | |
uses: docker/build-push-action@v4 | |
with: | |
push: false | |
build-args: "ADOT_JAVA_VERSION=${{ env.ADOT_JAVA_VERSION }}" | |
context: . | |
platforms: linux/amd64 | |
tags: ${{ env.IMAGE_TAG }} | |
load: true | |
- name: Test docker image | |
shell: bash | |
run: .github/scripts/test-adot-javaagent-image.sh "${{ env.IMAGE_TAG }}" "${{ env.ADOT_JAVA_VERSION }}" | |
- name: Build and push image | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
build-args: "ADOT_JAVA_VERSION=${{ env.ADOT_JAVA_VERSION }}" | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ env.IMAGE_TAG }} | |
- name: Upload to GitHub Actions | |
uses: actions/upload-artifact@v3 | |
with: | |
name: aws-opentelemetry-agent.jar | |
path: otelagent/build/libs/aws-opentelemetry-agent-*.jar | |
publish-build-status: | |
needs: [build] | |
if: ${{ always() }} | |
uses: ./.github/workflows/publish-status.yml | |
with: | |
namespace: 'ADOT/GitHubActions' | |
repository: ${{ github.repository }} | |
branch: ${{ github.ref_name }} | |
workflow: nightly-upstream-snapshot-build | |
success: ${{ needs.build.result == 'success' }} | |
region: us-west-2 | |
secrets: | |
roleArn: ${{ secrets.METRICS_ROLE_ARN }} |