Skip to content

Commit

Permalink
デプロイ先を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
uTen2c committed Feb 4, 2024
1 parent 845f8d1 commit 775387b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[CI-SKIP]')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- uses: gradle/wrapper-validation-action@v2
- id: grant-permission-to-gradlew
run: chmod +x ./gradlew
- name: Generate build number
id: buildnumber
uses: onyxmueller/[email protected]
with:
token: ${{ secrets.github_token }}
prefix: ${{ github.ref_name }}
- name: Publish
uses: uTen2c/publish[email protected]
with:
repo: ${{ secrets.REPO }}
token-user: ${{ secrets.TOKEN_USER }}
token: ${{ secrets.TOKEN }}
publish-task: publish -Peula=true
run: ./gradlew -Dorg.gradle.s3.endpoint=${{ env.S3_ENDPOINT }} publish --stacktrace
env:
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_PATH: ${{ secrets.S3_PATH }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
17 changes: 12 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ plugins {
`maven-publish`
}

val publishPath = System.getenv()["PUBLISH_PATH"]
val branch = System.getenv()["GITHUB_REF_NAME"] ?: "unknown"
val buildNumber = System.getenv()["BUILD_NUMBER"] ?: "local-SNAPSHOT"
val outputDirectory = (findProperty("output") ?: rootDir.resolve("MinestomData").absolutePath) as String
Expand Down Expand Up @@ -74,6 +73,10 @@ tasks.register<Jar>("dataJar") {
tasks.processResources.get().dependsOn("generateData")

publishing {
val uri = System.getenv()["S3_URI"]
val accessKey = System.getenv()["S3_ACCESS_KEY"]
val secretKey = System.getenv()["S3_SECRET_KEY"]

publications {
create<MavenPublication>("maven") {
groupId = "net.rainbootsmc"
Expand All @@ -83,10 +86,14 @@ publishing {
artifact(tasks.getByName("dataJar"))
}
}
if (publishPath != null) {
repositories {
maven {
url = uri(publishPath)
repositories {
maven {
if (uri != null) {
url = uri(uri)
}
credentials(AwsCredentials::class) {
this.accessKey = accessKey
this.secretKey = secretKey
}
}
}
Expand Down

0 comments on commit 775387b

Please sign in to comment.