Skip to content

Commit

Permalink
ci: Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sya-ri committed Nov 16, 2023
1 parent 54c63b3 commit c401af0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build
on: [push]
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
- name: Build
run: ./gradlew build
25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy
on:
workflow_dispatch:

env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}

jobs:
deploy-linux:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
cache: gradle
- name: Linux deploy
run: |
./gradlew publish --no-daemon --stacktrace
10 changes: 7 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ publishing {
},
)
credentials {
username = System.getenv("SONATYPE_USER")
password = System.getenv("SONATYPE_PASSWORD")
username = properties["sonatypeUsername"].toString()
password = properties["sonatypePassword"].toString()
}
}
}
Expand All @@ -60,7 +60,7 @@ publishing {
developer {
id.set("sya-ri")
name.set("sya-ri")
email.set("sya79lua@gmail.com")
email.set("contact@s7a.dev")
}
}
scm {
Expand All @@ -72,5 +72,9 @@ publishing {
}

signing {
val key = properties["signingKey"]?.toString()?.replace("\\n", "\n")
val password = properties["signingPassword"]?.toString()

useInMemoryPgpKeys(key, password)
sign(publishing.publications["maven"])
}

0 comments on commit c401af0

Please sign in to comment.