Skip to content

fix github release generation #13

fix github release generation

fix github release generation #13

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@v4
- uses: gradle/[email protected]
publish_plugin:
runs-on: ubuntu-latest
needs: [check-gradle-wrapper]
env:
ORG_GRADLE_PROJECT_publishChannel: ${{ secrets.PUBLISH_CHANNEL }}
ORG_GRADLE_PROJECT_publishToken: ${{ secrets.PUBLISH_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: corretto
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- 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@v4
- 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 `gh` 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
gh release create -F gh_release_description.md "${VERSION}" ./artifacts/*.zip