Skip to content

Update changelog (#148) #6

Update changelog (#148)

Update changelog (#148) #6

name: publish plugin on JB and create release on GH
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
jobs:
check-gradle-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
publish_plugin:
runs-on: ubuntu-latest
needs: [check-gradle-wrapper]
env:
ORG_GRADLE_PROJECT_publishChannel: stable
ORG_GRADLE_PROJECT_publishToken: ${{ secrets.PUBLISH_TOKEN }}
steps:
# Cache gradle dependencies
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: publish plugin
run: |
export ORG_GRADLE_PROJECT_pluginVersion="${GITHUB_REF/refs\/tags\//}"
./gradlew :plugin:publishPlugin
- name: Upload artifact
uses: actions/[email protected]
with:
name: plugin-artifact
path: ./plugin/build/distributions/*.zip
retention-days: 1
if-no-files-found: error
create_github_release:
runs-on: ubuntu-latest
needs : [ publish_plugin ]
steps:
- uses: actions/checkout@v2
- name: Download Artifact
uses: actions/download-artifact@v2
id: download
with:
name: plugin-artifact
path: ./artifacts/
- name: create or update release note PR
env:
# Required for the `hub` CLI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${GITHUB_REF/refs\/tags\//}"
echo -e "${VERSION}\n" > gh_release_description.md
sed -e '0,/Release notes for v/d' -e '/Release notes for v/,$d' CHANGELOG.md >> gh_release_description.md
assets=''
for file in $(ls ./artifacts/); do assets="${assets} -a ./artifacts/${file}"; done
echo "assets=${assets}"
hub release create -F gh_release_description.md ${assets} "${VERSION}"