Skip to content

Deploy

Deploy #30

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
inputs:
channel:
type: choice
description: Release channel
options:
- default
- eap
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 📝 Fetch Sources
uses: actions/checkout@v2
- name: 🛠 Prepare Build Environment
uses: ./.github/workflows/prepare-build-env
- name: 🔍 Extract Version
id: version
run: |
echo "PLUGIN_VERSION=$(./gradlew properties | grep -oP '(?<=pluginVersion: ).*')" >> $GITHUB_ENV
- name: 🏗 Build Plugin
uses: gradle/gradle-build-action@v2
with:
arguments: buildPlugin
- name: 🏗 Get current changelog
id: changelog_step
run: |
CHANGELOG=$(./gradlew getChangelog --console=plain -q --no-header)
echo $CHANGELOG
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=CHANGELOG_ALL::$CHANGELOG"
- name: 🚀 Create Release
uses: ncipollo/release-action@v1
with:
name: ${{ env.PLUGIN_VERSION }}
commit: ${{ github.sha }} # Commit SHA
tag: v${{ env.PLUGIN_VERSION }} # 'v' + version from gradle.properties
draft: true
body: ${{ steps.changelog_step.outputs.CHANGELOG_ALL }}
artifacts: "output/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🚀 Publish Plugin
uses: gradle/gradle-build-action@v2
with:
arguments: publishPlugin -PpublishToken=${{ secrets.JB_PUBLISH_TOKEN }} -PpublishChannel=${{ github.event.inputs.channel }}