Skip to content

Commit 7256434

Browse files
committed
update CI configuration to trigger builds on master and tag pushes, and add release creation step for tagged versions
1 parent ab98414 commit 7256434

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Automatically build the project and run any configured tests for every push
2-
# and submitted pull request. This can help catch issues that only occur on
3-
# certain platforms or Java versions, and provides a first line of defence
4-
# against bad commits.
5-
61
name: build
7-
on: [pull_request, push]
2+
on:
3+
push:
4+
branches: [ master ]
5+
tags: [ 'v*' ] # Run on pushes to master and on tags like v1.0.0
6+
pull_request:
7+
branches: [ master ]
88

99
jobs:
1010
build:
@@ -24,7 +24,13 @@ jobs:
2424
- name: build
2525
run: ./gradlew build
2626
- name: capture build artifacts
27+
if: "!startsWith(github.ref, 'refs/tags/')" # Don't upload to artifacts on tag pushes
2728
uses: actions/upload-artifact@v4
2829
with:
2930
name: Artifacts
30-
path: build/libs/
31+
path: build/libs/
32+
- name: create release
33+
if: startsWith(github.ref, 'refs/tags/') # Only run this step on tag pushes
34+
uses: softprops/action-gh-release@v2
35+
with:
36+
files: build/libs/*.jar

0 commit comments

Comments
 (0)