forked from windup/intellij-mta
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (86 loc) · 2.88 KB
/
ci.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI (Compile, Build, and Publish IntelliJ Plugin)
on:
push:
branches:
- "7.2.0"
pull_request:
branches:
- "7.2.0"
release:
types:
- created
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '11'
- name: Grant execute permissions to Gradle wrapper
run: chmod +x ./gradlew
- name: Verify Gradle Version (Using Project's Wrapper)
run: ./gradlew --version
- name: Cleanup Before Build
run: rm -rf build/distributions/*
- name: Build Plugin
run: ./gradlew clean buildPlugin --refresh-dependencies --stacktrace --info
package:
name: Package, Upload Plugin
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '11'
- name: Grant execute permissions to Gradle wrapper
run: chmod +x ./gradlew
- name: Cleanup Before Build
run: rm -rf build/distributions/*
- name: Build Plugin
run: ./gradlew clean buildPlugin --refresh-dependencies --stacktrace --info
- name: Ensure output directory exists
run: mkdir -p build/distributions
- name: Extract Plugin Zip Before Upload
run: unzip -d build/distributions/extracted build/distributions/org.jboss.tools.mta-7.2.0.zip
- name: Upload Plugin Artifact (As Folder)
uses: actions/upload-artifact@v4
with:
name: org.jboss.tools.mta-7.2.0
path: build/distributions/extracted
if-no-files-found: error
publish:
name: Publish to JetBrains Marketplace
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'release'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '11'
- name: Grant execute permissions to Gradle wrapper
run: chmod +x ./gradlew
- name: Build Plugin
run: ./gradlew clean buildPlugin --stacktrace --info
- name: Ensure Plugin Artifact Exists
run: ls -lah build/distributions/
- name: Publish to JetBrains Marketplace (Only for migtools)
run: |
if [ "${{ github.repository_owner }}" = "migtools" ]; then
echo "Publishing to JetBrains Marketplace..."
./gradlew publishPlugin -PintellijPublishToken=${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
else
echo "Skipping JetBrains Marketplace publishing since this is a fork."
fi