diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..51e417a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish package + +on: + push: + tags: + - '**' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: 'corretto' + + - name: Grant Permissions to gradlew + run: chmod +x gradlew + + - name: Run Gradle publish + run: ./gradlew publish + env: + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} \ No newline at end of file diff --git a/README.md b/README.md index a64e6e9..b91683f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation 'space.provided:dependency-injection:TAG' + implementation 'space.provided:dependency-injection:VERSION' } ``` @@ -32,7 +32,7 @@ dependencies { space.provided dependency-injection - TAG + VERSION ``` diff --git a/build.gradle b/build.gradle index 1977781..7412086 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,10 @@ plugins { id 'java' + id 'maven-publish' } group = 'space.provided' -version = '1.0.1' +version = '1.0.2' repositories { maven { url 'https://registry.provided.space' } @@ -12,3 +13,21 @@ repositories { dependencies { implementation 'space.provided:rs4j:1.0.0' } + +publishing { + publications { + maven(MavenPublication) { + from components.java + } + } + + repositories { + maven { + url = 'https://registry.provided.space' + credentials { + username = System.getenv('REGISTRY_USERNAME') + password = System.getenv('REGISTRY_PASSWORD') + } + } + } +}