1
1
# GitHub Action Workflow for building a new commit to the primary repo branch and publishing a new release to beta.
2
2
#
3
- # Workflow is triggered on pushes into master.
3
+ # Workflow is triggered on pushes. Beta publish job runs conditionally if pushed to master.
4
4
#
5
5
# Additional Docs:
6
6
# - GitHub Actions: https://help.github.com/en/actions
10
10
push :
11
11
paths-ignore :
12
12
- ' *.md'
13
- branches :
14
- - master
15
13
jobs :
16
14
17
15
# Build and test plugin and provide artifact.
18
16
build :
19
17
name : Build
20
- runs-on : ubuntu-latest
18
+ runs-on : codebuild-ion-intellij-plugin-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large
21
19
steps :
22
-
23
- - run : df
24
-
25
- # Check out current repository
26
- - name : Fetch Sources
27
- uses : actions/checkout@v2
28
-
29
- - name : Setup JDK
30
- uses : actions/setup-java@v3
20
+ - uses : actions/checkout@v4
21
+ - uses : actions/setup-java@v3
31
22
with :
32
23
distribution : ' corretto'
33
24
java-version : ' 17'
34
-
35
- - run : df
36
25
- uses : gradle/actions/setup-gradle@v4
37
26
38
- - run : df
27
+ # Build artifact using build Gradle task
28
+ - name : Build
29
+ run : ./gradlew build
30
+
39
31
# Build artifact using buildPlugin Gradle task
40
32
- name : Build Plugin
41
33
run : ./gradlew buildPlugin
42
34
43
- - run : df
44
- - name : Get Product Versions
45
- id : get-products
46
- run : |
47
- PRODUCTS="$(./gradlew printProductsReleases -q | jq -cnR '[inputs | select(length > 0)]')"
48
- echo "products=$PRODUCTS"
49
- echo "products=$PRODUCTS" >> "$GITHUB_OUTPUT"
50
-
51
- outputs :
52
- products : ${{ steps.get-products.outputs.products }}
53
-
54
- verify :
55
- runs-on : ubuntu-latest
56
- needs : build
57
- strategy :
58
- fail-fast : false
59
- matrix :
60
- product : ${{ fromJSON(needs.build.outputs.products) }}
61
- steps :
62
- - run : df
63
- - uses : actions/checkout@v4
64
- - run : df
65
- - uses : actions/setup-java@v3
66
- with :
67
- distribution : ' corretto'
68
- java-version : ' 17'
69
- - run : df
70
-
71
- # Cache Gradle dependencies
72
- - name : Setup Gradle Dependencies Cache
73
- uses : actions/cache@v2
74
- with :
75
- path : ~/.gradle/caches
76
- key : ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
77
-
78
- # Cache Gradle Wrapper
79
- - name : Setup Gradle Wrapper Cache
80
- uses : actions/cache@v2
81
- with :
82
- path : ~/.gradle/wrapper
83
- key : ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
84
-
85
- - run : df
86
-
87
- # Don't set up gradle here. We've already verified the gradle wrapper in the previous job.
88
-
89
35
# Run intellij:verifyPlugin task.
90
36
- name : Verify Plugin
91
- run : ./gradlew verifyPlugin -PverifyPlugin="${{ matrix.product }}"
37
+ run : ./gradlew verifyPlugin
92
38
93
39
publish-beta :
94
- needs : verify
95
- runs-on : ubuntu-latest
96
- if : github.repository == 'amazon-ion/ion-intellij-plugin'
40
+ needs : build
41
+ if : github.repository == 'amazon-ion/ion-intellij-plugin' && github.ref == 'refs/heads/master'
42
+ runs-on : codebuild-ion-intellij-plugin-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large
97
43
steps :
98
44
- uses : actions/checkout@v4
99
45
- uses : actions/setup-java@v3
@@ -107,11 +53,3 @@ jobs:
107
53
PUBLISH_TOKEN : ${{ secrets.JETBRAINS_TOKEN }}
108
54
PUBLISH_CHANNEL : beta
109
55
run : ./gradlew --stacktrace publishPlugin
110
-
111
- # Upload plugin artifact to make it available in the next jobs
112
- - name : Upload artifact
113
- if : github.repository == 'amazon-ion/ion-intellij-plugin'
114
- uses : actions/upload-artifact@v4
115
- with :
116
- name : plugin-artifact
117
- path : ./build/distributions/
0 commit comments