-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (47 loc) · 1.48 KB
/
build.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
name: Build
on: [push, workflow_dispatch]
jobs:
build-intellij:
runs-on: ubuntu-latest
# Changing WORKING_DIRECTORY, don't forget to change defaults.run.working-directory
env:
WORKING_DIRECTORY: intellij-plugin
defaults:
run:
working-directory: ./intellij-plugin
steps:
- name: Checkout the plugin GitHub repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- name: Check repository content
shell: bash
run: pwd && ls -la
- name: Test plugin
shell: bash
run: ./gradlew test
- name: Build plugin
shell: bash
run: ./gradlew buildPlugin
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/${{ env.WORKING_DIRECTORY }}/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
echo "zip artifact name:"
echo "$FILENAME"
- name: Publish built plugin to artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./${{ env.WORKING_DIRECTORY }}/build/distributions/content/*/*