Skip to content

Commit 537597a

Browse files
committed
Add workflows for GitHub
1 parent 447a1dd commit 537597a

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout Project
19+
uses: actions/checkout@v3.5.2
20+
21+
- name: Validate Gradle Wrapper
22+
uses: gradle/wrapper-validation-action@v1.0.6
23+
24+
- name: Configure JDK
25+
uses: actions/setup-java@v3.11.0
26+
with:
27+
distribution: 'temurin'
28+
java-version: '11'
29+
cache: gradle
30+
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x gradlew
33+
34+
- name: Run build with caching enabled
35+
uses: gradle/gradle-build-action@v2.4.2
36+
with:
37+
arguments: clean build -s
38+
39+
- name: Run Detekt
40+
run: ./gradlew detektMain

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release CI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 45
12+
13+
steps:
14+
- name: Checkout Project
15+
uses: actions/checkout@v4.0.0
16+
17+
- name: Validate Gradle Wrapper
18+
uses: gradle/wrapper-validation-action@v1.1.0
19+
20+
- name: Configure JDK
21+
uses: actions/setup-java@v3.12.0
22+
with:
23+
distribution: 'temurin'
24+
java-version: '17'
25+
cache: gradle
26+
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
30+
- name: Create Release
31+
id: create_release
32+
uses: actions/create-release@v1.1.4
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tag_name: ${{ github.ref }}
37+
release_name: ${{ github.ref }}
38+
draft: true
39+
prerelease: false
40+
41+
- name: Publish Gradle Plugin
42+
env:
43+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
44+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
45+
run: ./gradlew -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET publishPlugins

0 commit comments

Comments
 (0)