Skip to content

Commit fe03fc9

Browse files
committed
Add publishing
1 parent 712cc98 commit fe03fc9

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/build.yml

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
name: Build
22

33
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:
811

912
jobs:
1013
build:
@@ -28,7 +31,18 @@ jobs:
2831
- name: Gradle Build
2932
run: ./gradlew build
3033

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

0 commit comments

Comments
 (0)