File tree 1 file changed +22
-8
lines changed
1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change 1
1
name : Build
2
2
3
3
on :
4
- push :
5
- branches :
6
- - " **"
7
- workflow_dispatch :
4
+ push :
5
+ branches : [ "**" ]
6
+ tags-ignore : [ "**" ]
7
+ pull_request :
8
+ release :
9
+ types : [ published ]
10
+ workflow_dispatch :
8
11
9
12
jobs :
10
13
build :
28
31
- name : Gradle Build
29
32
run : ./gradlew build
30
33
31
- - uses : actions/upload-artifact@v3
32
- with :
33
- name : interfaces-artifacts
34
- path : " **/build/libs/*.jar"
34
+ - name : Determine Status
35
+ run : |
36
+ if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
37
+ echo "STATUS=snapshot" >> $GITHUB_ENV
38
+ else
39
+ echo "STATUS=release" >> $GITHUB_ENV
40
+ fi
41
+
42
+ - name : Publish Snapshot
43
+ if : " ${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
44
+ run : ./gradlew publish
45
+
46
+ - name : Publish Release
47
+ if : " ${{ env.STATUS == 'release' && github.event_name == 'release' }}"
48
+ run : ./gradlew publish
You can’t perform that action at this time.
0 commit comments