-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NH-86008: update pipeline configuration file
- Loading branch information
1 parent
5acfce1
commit a498bc4
Showing
6 changed files
with
115 additions
and
229 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
# This workflow does the following things: | ||
# 1. build and test the core Joboe libs (core, metrics and dependencies) | ||
# 1. build and test the core Joboe libs (core, metrics, config, logging and sampling) | ||
# 2. publish the jars to Github Packages (which can be used by the NightHawk agent at https://github.com/appoptics/opentelemetry-java-instrumentation-custom-distro) | ||
# 3. make a **draft** release on Github and upload the jars as artifacts (you may need to publish the release manually after it) | ||
|
||
# The workflow needs to be triggered manually. (go to the Actions tab in the repo page, choose the workflow and click `Run Workflow`) | ||
# The draft release will be named based on the `revision` property in the pom file. For example, if the pom revision is 7.0.4, the release | ||
# will be named as "v7.0.4" | ||
name: Build and Publish Core libs with Maven | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: write | ||
contents: write | ||
id-token: write | ||
|
||
jobs: | ||
publish: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref_name }} | ||
- name: Set up JDK 8 for Maven running on JDK9+ | ||
id: setup-jdk-8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8.0.112 | ||
- name: Set up JDK 11 for building the Joboe core libs | ||
uses: actions/setup-java@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
java-version: 8.0.302 | ||
distribution: 'temurin' | ||
|
||
- name: Set version env to pom version | ||
run: | | ||
echo "POM_VERSION=v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
- name: Publish package | ||
run: mvn -Dmaven.resolver.transport=wagon --batch-mode deploy | ||
env: | ||
JAVA_1_8_HOME: "${{ steps.setup-jdk-8.outputs.path }}" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Release and upload artifacts | ||
run: gh release create ${{ env.POM_VERSION }} --title "${{ env.POM_VERSION }}" --notes "for the OpenTelemetry custom distro" --target ${{ github.ref_name }} --draft core/target/core-*.jar dependencies/target/dependencies-*.jar metrics/target/metrics-*.jar | ||
run: | | ||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
NEW_VERSION=${VERSION%%-SNAPSHOT} | ||
mvn versions:set -DnewVersion=$NEW_VERSION | ||
mvn -s .github/m2/settings.xml -Dmaven.resolver.transport=wagon --batch-mode deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Push | ||
|
||
on: | ||
push: | ||
|
||
permissions: | ||
packages: write | ||
contents: write | ||
id-token: write | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 8.0.302 | ||
distribution: 'temurin' | ||
|
||
- name: Run maven verify | ||
run: | | ||
mvn -s .github/m2/settings.xml clean verify | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: core/target/coverage-report | ||
name: coverage report | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
path: core/target/surefire-reports | ||
name: unit test report | ||
|
||
- name: Check shading(core) | ||
run: | | ||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
code=0 | ||
for path in $(jar tf "core/target/core-$VERSION.jar" | grep -E -v '^((com/solarwinds|META))') | ||
do | ||
PACKAGE=$(echo "$path" | awk -F/ '{print $2}') | ||
if [ -n "$PACKAGE" ]; then | ||
echo "Package ($path) is not shaded" | ||
code=1 | ||
fi | ||
done | ||
exit $code | ||
- name: Check shading(metric) | ||
run: | | ||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
code=0 | ||
for path in $(jar tf "metrics/target/metrics-$VERSION.jar" | grep -E -v '^((com/solarwinds|META))') | ||
do | ||
PACKAGE=$(echo "$path" | awk -F/ '{print $2}') | ||
if [ -n "$PACKAGE" ]; then | ||
echo "Package ($path) is not shaded" | ||
code=1 | ||
fi | ||
done | ||
exit $code | ||
deploy_snapshot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 8.0.302 | ||
distribution: 'temurin' | ||
|
||
- name: Deploy snapshot | ||
run: | | ||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
BRANCH=$(echo -n "${GITHUB_REF_NAME}" | sed -e 's/[^0-9a-zA-Z\._\-]/./g' | tr '[:upper:]' '[:lower:]') | ||
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | ||
NEW_VERSION=${VERSION%%-SNAPSHOT}-$BRANCH-$GIT_HASH-SNAPSHOT | ||
mvn versions:set -DnewVersion=$NEW_VERSION | ||
mvn -s .github/m2/settings.xml -T 8 deploy -DskipTests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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