-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Release workflow using Jenkins (#13)
* Add Release workflow using Jenkins Signed-off-by: Khushboo Rajput <khushbr@amazon.com> --------- Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
- Loading branch information
Showing
6 changed files
with
104 additions
and
67 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Release drafter | ||
|
||
# Push events to every tag not containing "/" | ||
# | ||
# Publish the commons JAR to Maven Local, and create 'artifacts.tar.gz' | ||
# using build dir and adding the contents of repository | ||
# | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
draft-a-release: | ||
name: Draft a release | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- id: get_data | ||
run: | | ||
echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '*\n ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT | ||
echo "version=$(cat version.properties)" >> $GITHUB_OUTPUT | ||
- uses: trstringer/manual-approval@v1 | ||
with: | ||
secret: ${{ github.TOKEN }} | ||
approvers: ${{ steps.get_data.outputs.approvers }} | ||
minimum-approvals: 2 | ||
issue-title: 'Release spring-data-opensearch ${{ steps.get_data.outputs.version }}' | ||
issue-body: "Please approve or deny the release of spring-data-opensearch **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }} **VERSION** : ${{ steps.get_data.outputs.version }} " | ||
exclude-workflow-initiator-as-approver: true | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Build with Gradle | ||
run: | | ||
./gradlew --no-daemon -Dbuild.snapshot=false publishCreatePublicationToLocalRepoRepository && tar -C build -cvf artifacts.tar.gz repository | ||
- name: Draft a release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
generate_release_notes: true | ||
files: | | ||
artifacts.tar.gz |
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,16 @@ | ||
lib = library(identifier: 'jenkins@1.5.3', retriever: modernSCM([ | ||
$class: 'GitSCMSource', | ||
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git', | ||
])) | ||
|
||
standardReleasePipelineWithGenericTrigger( | ||
tokenIdCredential: 'jenkins-performance-analyzer-commons-generic-webhook-token', | ||
causeString: 'A tag was cut on opensearch-project/performance-analyzer-commons repository causing this workflow to run', | ||
downloadReleaseAsset: true, | ||
publishRelease: true) { | ||
publishToMaven( | ||
signingArtifactsPath: "$WORKSPACE/repository/", | ||
mavenArtifactsPath: "$WORKSPACE/repository/", | ||
autoPublish: true | ||
) | ||
} |
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 @@ | ||
version=1.0.0 |