Skip to content

Commit

Permalink
Added GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGorisse committed Aug 4, 2023
1 parent 1c985f4 commit 9a0bb3b
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 4 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
name: Debug build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build library
run: ./gradlew assembleDebug --stacktrace
18 changes: 18 additions & 0 deletions .github/workflows/close-issues-and-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 5 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
close-issue-message: 'Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.'
stale-issue-message: 'Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.'
days-before-stale: 90
days-before-close: 7
enable-statistics: true
operations-per-run: 60
exempt-issue-labels: 'acknowledged,needs-triage'
30 changes: 30 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Release To Maven Central

on:
# Run this workflow when a new GitHub release is created
# release:
# types: [ released ]
workflow_dispatch:

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Publish release
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
36 changes: 36 additions & 0 deletions .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Upload release to Sonatype Staging Repository

# Run this workflow when a tag is pushed
on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
publish:
name: Release build and updload
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Upload release to Sonatype Staging Repository
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
#SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
#SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
#SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0'
// Maven Central Publish
classpath "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
}
}

Expand All @@ -41,6 +42,14 @@ allprojects {
}
}

allprojects {
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
// sonatypeHost = "S01"
}
}
}

task printProjectProperties {
project.properties.each { println " $it" }
}
5 changes: 4 additions & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
// id 'com.vanniktech.maven.publish'
id 'com.vanniktech.maven.publish'
}

group = GROUP
version = VERSION_NAME

android {
compileSdk rootProject.ext.compileSdk
compileSdkVersion rootProject.ext.compileSdk
Expand Down
5 changes: 4 additions & 1 deletion sceneform/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
// id 'com.vanniktech.maven.publish'
id 'com.vanniktech.maven.publish'
}

group = GROUP
version = VERSION_NAME

android {
compileSdk rootProject.ext.compileSdk
compileSdkVersion rootProject.ext.compileSdk
Expand Down
5 changes: 4 additions & 1 deletion ux/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
// id 'com.vanniktech.maven.publish'
id 'com.vanniktech.maven.publish'
}

group = GROUP
version = VERSION_NAME

android {
compileSdk rootProject.ext.compileSdk
compileSdkVersion rootProject.ext.compileSdk
Expand Down

0 comments on commit 9a0bb3b

Please sign in to comment.