Skip to content

Commit 772f66e

Browse files
committed
chore: separate build and release workflows
1 parent f959f35 commit 772f66e

File tree

2 files changed

+59
-16
lines changed

2 files changed

+59
-16
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,3 @@ jobs:
3232

3333
- name: Run integration tests
3434
run: ./gradlew integrationTest --no-daemon
35-
36-
- name: Upload build artifacts
37-
if: success()
38-
uses: actions/upload-artifact@v4
39-
with:
40-
name: build-artifacts
41-
path: build/libs/
42-
43-
- name: Upload test results
44-
if: always()
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: test-results
48-
path: |
49-
build/reports/tests/
50-
build/test-results/

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '21'
21+
distribution: 'temurin'
22+
cache: gradle
23+
24+
- name: Grant execute permission for gradlew
25+
run: chmod +x gradlew
26+
27+
- name: Build with Gradle
28+
run: ./gradlew build --no-daemon
29+
30+
- name: Run tests
31+
run: ./gradlew test --no-daemon
32+
33+
- name: Run integration tests
34+
run: ./gradlew integrationTest --no-daemon
35+
36+
- name: Upload build artifacts
37+
if: success()
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: build-artifacts
41+
path: build/libs/
42+
43+
- name: Upload test results
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: test-results
48+
path: |
49+
build/reports/tests/
50+
build/test-results/
51+
52+
- name: Create GitHub Release
53+
if: success() && startsWith(github.ref, 'refs/tags/')
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
files: build/libs/*.jar
57+
generate_release_notes: true
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)