From 1462f3b4cfb6f2cb6c4e34fd0c1a549520b68c6a Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Thu, 4 Mar 2021 16:04:30 +0100 Subject: [PATCH] chore: adopt conventional commits Signed-off-by: Jeff MAURY --- .github/workflows/conventionalCheck.yml | 16 ++++++++ .github/workflows/release.yml | 49 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/conventionalCheck.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/conventionalCheck.yml b/.github/workflows/conventionalCheck.yml new file mode 100644 index 0000000..80741cd --- /dev/null +++ b/.github/workflows/conventionalCheck.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddc33f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +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,build:Builds,chore:Other' + scopes-mapping: 'UI:UI,Hub:Hub' + - 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/com.redhat.devtools.intellij.tekton-${{ steps.get_version.outputs.VERSION }}.zip' + asset_name: 'Dependency-Analytics-${{ steps.get_version.outputs.VERSION }}.zip' + asset_content_type: application/zip \ No newline at end of file