Skip to content

Commit

Permalink
Add workflow for publishing package
Browse files Browse the repository at this point in the history
  • Loading branch information
vadage committed Apr 2, 2024
1 parent e848d52 commit 070469e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}
dependencies {
implementation 'space.provided:dependency-injection:TAG'
implementation 'space.provided:dependency-injection:VERSION'
}
```

Expand All @@ -32,7 +32,7 @@ dependencies {
<dependency>
<groupId>space.provided</groupId>
<artifactId>dependency-injection</artifactId>
<version>TAG</version>
<version>VERSION</version>
</dependency>
</dependencies>
```
Expand Down
21 changes: 20 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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' }
Expand All @@ -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')
}
}
}
}

0 comments on commit 070469e

Please sign in to comment.