-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary - artifacts publications have been disabled since [2.5.11](https://github.com/linkedin/kafka-monitor/releases/tag/) - which prevents apps that depend on KM to update to the latest versions - PR adds Github Action to publish to JFrog Artifactory on release tag creation - as well as Artifactory and Gradle integration ## Testing Done 1. [workflow ran successfully](https://github.com/linkedin/kafka-monitor/runs/8278325597?check_suite_focus=true#step:6:39) and 2. publish went through — [test version 0.0.0 in JFROG](https://linkedin.jfrog.io/ui/packages/gav:%2F%2Fcom.linkedin.kmf:kafka-monitor/0.0.0?name=kafka-monitor&type=packages&activeTab=builds)
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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,34 @@ | ||
name: tag (release) flow | ||
|
||
on: | ||
create: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
gradle-java8: | ||
name: Java 8 release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
# bring in all history because the gradle versions plugin needs to "walk back" to the closest ancestor tag | ||
# to figure out what version this is. optimizing this is left as a challenge to future committers | ||
fetch-depth: 0 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build with Gradle | ||
# add --info or --debug below for more details when trying to understand issues | ||
run: ./gradlew clean build javadoc --stacktrace --warning-mode all --no-daemon | ||
- name: Branch tag | ||
id: branch_tag | ||
run: echo ::set-output name=RELEASE_TAG::${GITHUB_REF#refs/tags/} | ||
- name: Publish to Jfrog | ||
env: | ||
JFROG_USER: ${{ secrets.JFROG_USER }} | ||
JFROG_KEY: ${{ secrets.JFROG_KEY }} | ||
RELEASE_TAG: ${{ steps.branch_tag.outputs.RELEASE_TAG }} | ||
run: ./scripts/publishToJfrog.sh |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
result=${PWD##*/} | ||
if [[ "$result" = "scripts" ]] | ||
then | ||
echo "script must be run from root project folder, not $PWD" | ||
exit 1 | ||
else | ||
echo "we are in $PWD and tag is $RELEASE_TAG" | ||
|
||
if [[ $RELEASE_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] | ||
then | ||
echo "publishing: tag $RELEASE_TAG looks like a semver" | ||
git status | ||
git describe --tags | ||
./gradlew printVersion | ||
./gradlew publishMyPublicationPublicationToLinkedInJfrogRepository | ||
else | ||
echo "not publishing: tag $RELEASE_TAG is NOT a valid semantic version (x.y.z)" | ||
fi | ||
fi |