Skip to content

Commit

Permalink
Add GitHub Action for publishing library (#3)
Browse files Browse the repository at this point in the history
* Add GitHub Action for publishing library

* Fix.
  • Loading branch information
vLuckyyy authored Jul 13, 2024
1 parent dfafa72 commit fd5446e
Showing 2 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish CraftingLib
on:
release:
branches: [ master ]
types: [ published ]
jobs:
publish:
runs-on: ubuntu-latest
environment: deployment
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Publish with Gradle
run: ./gradlew clean build publish
env:
ETERNAL_CODE_MAVEN_USERNAME: ${{ secrets.ETERNAL_CODE_MAVEN_USERNAME }}
ETERNAL_CODE_MAVEN_PASSWORD: ${{ secrets.ETERNAL_CODE_MAVEN_PASSWORD }}
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -52,5 +52,13 @@ publishing {

repositories {
mavenLocal()
maven {
name = "eternalcodeReleases"
url = uri("https://repo.eternalcode.pl/releases")
credentials {
username = System.getenv("ETERNAL_CODE_MAVEN_USERNAME")
password = System.getenv("ETERNAL_CODE_MAVEN_PASSWORD")
}
}
}
}

0 comments on commit fd5446e

Please sign in to comment.