diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b58657f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy + +on: + workflow_dispatch: + push: + paths-ignore: + - "**.md" + - "renovate.json" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Prepare gradle.properties + run: | + mkdir -p $HOME/.gradle + echo "repoUsername=${{ secrets.REPO_USERNAME }}" >> $HOME/.gradle/gradle.properties + echo "repoPassword=${{ secrets.REPO_PASSWORD }}" >> $HOME/.gradle/gradle.properties + - name: Deploy + run: ./gradlew clean publish diff --git a/build.gradle.kts b/build.gradle.kts index 12cb11e..d49a502 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,6 +61,19 @@ allprojects { } publishing { + repositories { + maven { + name = "repo" + credentials(PasswordCredentials::class) + url = uri( + if (project.version.toString().endsWith("SNAPSHOT")) + project.findProperty("deploySnapshotURL") ?: System.getProperty("deploySnapshotURL", "https://repo.azisaba.net/repository/maven-snapshots/") + else + project.findProperty("deployReleasesURL") ?: System.getProperty("deployReleasesURL", "https://repo.azisaba.net/repository/maven-releases/") + ) + } + } + publications { create("mavenJava") { from(components["java"])