Skip to content

Commit

Permalink
NH-86008: update pipeline configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Oct 2, 2024
1 parent 5acfce1 commit 026e30a
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 226 deletions.
193 changes: 0 additions & 193 deletions .circleci/config.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .circleci/images/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions .circleci/m2/settings.xml → .github/m2/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<servers>
<server>
<id>github-write</id>
<username>lt-global-circleci</username>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
<server>
<id>github-read</id>
<username>lt-global-circleci</username>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
Expand Down
50 changes: 30 additions & 20 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
# 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
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:
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: |
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 metrics/target/metrics-*.jar core/target/config-*.jar \
metrics/target/logging-*.jar metrics/target/sampling-*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Push

on:
push:

permissions:
packages: write
contents: write
id-token: write

jobs:
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<repository>
<id>github-write</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/solarwinds-cloud/maven-releases</url>
<url>https://maven.pkg.github.com/solarwinds/joboe</url>
</repository>
</distributionManagement>
<dependencyManagement>
Expand Down

0 comments on commit 026e30a

Please sign in to comment.