Skip to content

Commit

Permalink
setup github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Tan108 committed Mar 13, 2024
1 parent 12e2bbe commit f3163ec
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @featurevisor/kotlin-maintainers
30 changes: 30 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check commits in all branches (including main)

on: push

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: 11

- name: Setup build cache
uses: actions/[email protected]
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build

- name: Test with Gradle
run: ./gradlew test
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish release

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout latest code
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: 11

- name: Setup build cache
uses: actions/[email protected]
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Publish artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
echo "Github username: ${GITHUB_ACTOR}"
./gradlew -Pversion=${NEW_VERSION} publish
22 changes: 17 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@ plugins {
`maven-publish`
}

group = "com.featurevisor"
version = "1.0.0"


repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}

publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
// Include any other artifacts here, like javadocs
}
}

repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/featurevisor/featurevisor-kotlin-plugin")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

Expand All @@ -26,6 +35,9 @@ gradlePlugin {
create("featurevisor-plugin") {
id = "com.featurevisor.plugin"
implementationClass = "com.featurevisor.plugin.TestRunnerPlugin"
// displayName = "Featurevisor Plugin"
// description = "Need to use this plugin to "
// tags.set(listOf("test-runner", "run-test-case", "test"))
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
kotlin.code.style=official
group=com.featurevisor
version=0.0.1-SNAPSHOT
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
rootProject.name = "Featurevisor-kotlin-plugin"
rootProject.name = "featurevisor-kotlin-plugin"

0 comments on commit f3163ec

Please sign in to comment.