Initial Implementation of OpenTelemetry Metrics Publisher for Java AWS SDK #11
Workflow file for this run
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: 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@v4 | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v4 | |
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 | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- 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: Publish package | |
run: mvn --batch-mode deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |