Skip to content

Commit

Permalink
NH-37575: download agent from GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Jul 2, 2024
1 parent d3b8893 commit a414529
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: |
VERSION=$(unzip -p agent/build/libs/solarwinds-apm-agent.jar META-INF/MANIFEST.MF | grep Implementation-Version | awk '{ print $2 }')
VERSION=$(echo $VERSION | sed 's/[^a-z0-9.-]//g') # remove illegal characters
VERSION="$VERSION-alpha"
VERSION="$VERSION.alpha"
echo "Current version is $VERSION"
response=$(curl -fs -L \
Expand Down Expand Up @@ -77,6 +77,46 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

github_release_clean:
runs-on: ubuntu-latest
needs:
- benchmark
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Build agent
run: ./gradlew clean build -x test

- name: Clean up Pre-release
run: |
VERSION=$(unzip -p agent/build/libs/solarwinds-apm-agent.jar META-INF/MANIFEST.MF | grep Implementation-Version | awk '{ print $2 }')
VERSION=$(echo $VERSION | sed 's/[^a-z0-9.-]//g') # remove illegal characters
VERSION="$VERSION.alpha"
echo "Current version is $VERSION"
response=$(curl -fs -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/v$VERSION
release_id=$(echo "$response" | jq -r '.id')
curl -fsL \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$release_id
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

s3-stage-upload: # this job uploads the jar to stage s3
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -139,6 +179,7 @@ jobs:
--acl public-read


build-test-images:
runs-on: ubuntu-latest
needs:
Expand Down

0 comments on commit a414529

Please sign in to comment.