generated from JetBrains/intellij-platform-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (58 loc) · 2.09 KB
/
release.yml
File metadata and controls
71 lines (58 loc) · 2.09 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Publish JetBrains Plugin
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'jetbrains'
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Increment Version
id: version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Access current version from gradle.properties
CURRENT_VERSION=$(grep "pluginVersion=" gradle.properties | cut -d'=' -f2)
# Splitting version
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
# Replace original pluginVersion в gradle.properties
sed -i -e "s/pluginVersion=.*/pluginVersion=${NEW_VERSION}/g" gradle.properties
# Export version number
echo "version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
- name: Create .env file
run: |
echo "PUBLISH_TOKEN=${{ secrets.JETBRAINS_PUBLISH_TOKEN }}" > .env
- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }}
run: |
./gradlew publishPlugin
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
add: 'gradle.properties'
author_name: GitHub Actions
author_email: actions@github.com
message: "Bump version to ${{ steps.version.outputs.version }}"
tag: "v${{ steps.version.outputs.version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
generate_release_notes: true
files:
"build/distributions/Git Codeowners-${{ steps.version.outputs.version }}.zip"