Skip to content

Initial Implementation of OpenTelemetry Metrics Publisher for Java AWS SDK #8

Initial Implementation of OpenTelemetry Metrics Publisher for Java AWS SDK

Initial Implementation of OpenTelemetry Metrics Publisher for Java AWS SDK #8

Workflow file for this run

name: Java CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macos-latest
java-version:
- '17'
- '21'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'corretto'
cache: maven
- name: Grant execute permission for Maven Wrapper
if: runner.os != 'Windows'
run: chmod +x mvnw
- name: Build with Maven Wrapper
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./mvnw.cmd clean verify
else
./mvnw clean verify
fi
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: target/surefire-reports/*.xml
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Set up GPG
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import
echo "default-key ${GPG_KEY_ID}" >> ~/.gnupg/gpg.conf
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Grant execute permission for Maven Wrapper
run: chmod +x mvnw
- name: Get Project Version
id: get_version
run: echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Determine if SNAPSHOT Version
run: |
if [[ "${{ env.VERSION }}" == *"-SNAPSHOT" ]]; then
echo "IS_SNAPSHOT=true" >> $GITHUB_ENV
else
echo "IS_SNAPSHOT=false" >> $GITHUB_ENV
fi
- name: Deploy to Maven Central
run: ./mvnw clean deploy -P release
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}