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 Mar 30, 2024
1 parent 36f71b1 commit 4af2598
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 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:
test:
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 }}
8 changes: 8 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'java'
id 'maven-publish'
}

group = 'space.provided'
Expand All @@ -17,3 +18,21 @@ dependencies {
test {
useJUnitPlatform()
}

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 4af2598

Please sign in to comment.