Skip to content

Commit cc21968

Browse files
authored
setup github action (#3)
1 parent 12e2bbe commit cc21968

File tree

6 files changed

+88
-6
lines changed

6 files changed

+88
-6
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @featurevisor/kotlin-maintainers

.github/workflows/checks.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check commits in all branches (including main)
2+
3+
on: push
4+
5+
jobs:
6+
checks:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout latest code
10+
uses: actions/checkout@v3
11+
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v3
14+
with:
15+
distribution: "adopt"
16+
java-version: 11
17+
18+
- name: Setup build cache
19+
uses: actions/[email protected]
20+
with:
21+
path: ~/.gradle/caches
22+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
23+
restore-keys: |
24+
${{ runner.os }}-gradle-
25+
26+
- name: Build with Gradle
27+
run: ./gradlew build
28+
29+
- name: Test with Gradle
30+
run: ./gradlew test

.github/workflows/publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout latest code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v3
17+
with:
18+
distribution: "adopt"
19+
java-version: 11
20+
21+
- name: Setup build cache
22+
uses: actions/[email protected]
23+
with:
24+
path: ~/.gradle/caches
25+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
26+
restore-keys: |
27+
${{ runner.os }}-gradle-
28+
29+
- name: Publish artifact
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
run: |
34+
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
35+
echo "New version: ${NEW_VERSION}"
36+
echo "Github username: ${GITHUB_ACTOR}"
37+
./gradlew -Pversion=${NEW_VERSION} publish

build.gradle.kts

+17-5
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,28 @@ plugins {
55
`maven-publish`
66
}
77

8-
group = "com.featurevisor"
9-
version = "1.0.0"
10-
11-
128
repositories {
139
mavenCentral()
1410
maven { url = uri("https://jitpack.io") }
1511
}
1612

1713
publishing {
14+
publications {
15+
create<MavenPublication>("default") {
16+
from(components["java"])
17+
// Include any other artifacts here, like javadocs
18+
}
19+
}
1820

1921
repositories {
20-
mavenLocal()
22+
maven {
23+
name = "GitHubPackages"
24+
url = uri("https://maven.pkg.github.com/featurevisor/featurevisor-kotlin-plugin")
25+
credentials {
26+
username = System.getenv("GITHUB_ACTOR")
27+
password = System.getenv("GITHUB_TOKEN")
28+
}
29+
}
2130
}
2231
}
2332

@@ -26,6 +35,9 @@ gradlePlugin {
2635
create("featurevisor-plugin") {
2736
id = "com.featurevisor.plugin"
2837
implementationClass = "com.featurevisor.plugin.TestRunnerPlugin"
38+
// displayName = "Featurevisor Plugin"
39+
// description = "Need to use this plugin to "
40+
// tags.set(listOf("test-runner", "run-test-case", "test"))
2941
}
3042
}
3143
}

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
kotlin.code.style=official
2+
group=com.featurevisor
3+
version=0.0.1-SNAPSHOT

settings.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
22
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
33
}
4-
rootProject.name = "Featurevisor-kotlin-plugin"
4+
rootProject.name = "featurevisor-kotlin-plugin"
55

0 commit comments

Comments
 (0)