-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add missing files Signed-off-by: Jeff MAURY <jmaury@redhat.com>
- Loading branch information
Showing
4 changed files
with
122 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,16 @@ | ||
name: "Conventional Commits PR Check" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v3.1.0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Generate changelog and plugin archive for new release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew buildPlugin | ||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | ||
- name: Simple conventional changelog | ||
uses: lstocchi/simple-conventional-changelog@0.0.6 | ||
id: changelog | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
current-tag: ${{ steps.get_version.outputs.VERSION }} | ||
types-mapping: 'feat:Features,fix:Bug Fixes,docs:Documentation,refactor:Refactoring,chore:Other' | ||
- run: | | ||
echo '${{ steps.changelog.outputs.changelog }}' | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.get_version.outputs.VERSION }} | ||
release_name: ${{ steps.get_version.outputs.VERSION }} | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
- name: Attach zip to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: '${{ github.workspace }}/build/distributions/Telemetry by Red Hat-${{ steps.get_version.outputs.VERSION }}.zip' | ||
asset_name: 'Telemetry by Red Hat-${{ steps.get_version.outputs.VERSION }}.zip' | ||
asset_content_type: application/zip |
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,6 @@ | ||
target | ||
.idea | ||
*.iml | ||
build | ||
.gradle | ||
out |
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,52 @@ | ||
#!/usr/bin/env groovy | ||
|
||
node('rhel7'){ | ||
stage('Checkout repo') { | ||
deleteDir() | ||
git url: 'https://github.com/redhat-developer/intellij-redhat-telemetry', | ||
branch: "${sha1}" | ||
} | ||
|
||
def props = readProperties file: 'gradle.properties' | ||
def isSnapshot = props['projectVersion'].contains('-SNAPSHOT') | ||
def version = isSnapshot?props['projectVersion'].replace('-SNAPSHOT', ".${env.BUILD_NUMBER}"):props['projectVersion'] + ".${env.BUILD_NUMBER}" | ||
|
||
stage('Build') { | ||
sh "./gradlew assemble -PprojectVersion=${version}" | ||
} | ||
|
||
stage('Package') { | ||
sh "./gradlew buildPlugin -PprojectVersion=${version}" | ||
} | ||
|
||
if(params.UPLOAD_LOCATION) { | ||
stage('Upload') { | ||
def filesToPush = findFiles(glob: '**/*.zip') | ||
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${filesToPush[0].path} ${UPLOAD_LOCATION}/snapshots/intellij-redhat-telemetry/" | ||
stash name:'zip', includes:filesToPush[0].path | ||
} | ||
} | ||
|
||
if(publishToMarketPlace.equals('true')){ | ||
timeout(time:5, unit:'DAYS') { | ||
input message:'Approve deployment?', submitter: 'jmaury' | ||
} | ||
|
||
def channel = isSnapshot?"nightly":"stable" | ||
|
||
stage("Publish to Marketplace") { | ||
unstash 'zip' | ||
withCredentials([[$class: 'StringBinding', credentialsId: 'JetBrains marketplace token', variable: 'TOKEN']]) { | ||
sh "./gradlew publishPlugin -PjetBrainsToken=${TOKEN} -PprojectVersion=${version} -PjetBrainsChannel=${channel}" | ||
} | ||
archive includes:"**.zip" | ||
|
||
if (!isSnapshot) { | ||
stage("Promote the build to stable") { | ||
def zip = findFiles(glob: '**/*.zip') | ||
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${zip[0].path} ${UPLOAD_LOCATION}/stable/intellij-redhat-telemetry/" | ||
} | ||
} | ||
} | ||
} | ||
} |