-
Notifications
You must be signed in to change notification settings - Fork 14
58 lines (50 loc) · 1.74 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 "CHANGELOG_ALL=$CHANGELOG" >> "$GITHUB_OUTPUT"
- 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: "build/distributions/*.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 }}