From 530f0c33f0eb9cfbb36567715a9fc0fec7237747 Mon Sep 17 00:00:00 2001 From: icecream Date: Wed, 28 Aug 2024 23:48:45 +0800 Subject: [PATCH] github action --- .github/workflows/deploy.yml | 17 +++++++++++++++++ build.gradle.kts | 5 ++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e64a089 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,17 @@ +name: deploy + +on: + push: + branches: + - deploy + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: ./gradlew publish + env: + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 7ea77a6..a61c7cb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -80,10 +80,9 @@ subprojects { val releasesRepoUrl = "https://maven.icecreamqaq.com/repository/maven-releases/" url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl) - credentials { - username = "" - password = "" + System.getenv("MAVEN_USER")?.let { username = it } + System.getenv("MAVEN_TOKEN")?.let { password = it } } } }