diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bca7132 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..4eeb508 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/build.gradle.kts b/build.gradle.kts index ab3aa46..c37e613 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,8 +34,8 @@ publishing { }, ) credentials { - username = System.getenv("SONATYPE_USER") - password = System.getenv("SONATYPE_PASSWORD") + username = properties["sonatypeUsername"].toString() + password = properties["sonatypePassword"].toString() } } } @@ -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 { @@ -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"]) }