Skip to content

Commit ab35f4a

Browse files
authored
GH-2 Add auto build and deploy to repo (#2)
* Add auto build and deploy to repo * Change names of variables * Run on publish new tag * Update readme
1 parent 542c90a commit ab35f4a

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

.github/workflows/buildAndPush.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish package to EternalCode Repository
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-java@v3
14+
with:
15+
java-version: '17'
16+
distribution: 'adopt'
17+
- name: Validate Gradle wrapper
18+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
19+
- name: Publish package
20+
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
21+
with:
22+
arguments: publish
23+
env:
24+
E_REPO_USERNAME: ${{ secrets.E_REPO_USERNAME }}
25+
E_REPO_PASS: ${{ secrets.E_REPO_PASS }}
26+
E_VERSION: ${{ github.ref_name }}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# EternalUpdater
22
✔ Updater for EternalCode plugins
3+
4+
5+
# Example usage
6+
```java
7+
import com.eternalcode.eternalupdater.EternalUpdater;
8+
9+
EternalUpdater eternalUpdater = new EternalUpdater("name", "currentPluginVer", "githubrepo");
10+
RemoteInformation pluginUpdate = eternalUpdater.checkUpdates();
11+
```

build.gradle.kts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import java.net.URI
2+
13
plugins {
24
`java-library`
35
`maven-publish`
46
}
57

68
group = "com.eternalcode"
7-
version = "1.0.0"
9+
version = System.getenv("E_VERSION")
810

911
repositories {
1012
mavenCentral()
@@ -21,6 +23,22 @@ dependencies {
2123
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
2224
}
2325

26+
publishing {
27+
publications {
28+
29+
}
30+
repositories {
31+
maven {
32+
name = "eternalcode-repository"
33+
url = URI("https://repo.eternalcode.pl")
34+
credentials {
35+
username = System.getenv("E_REPO_USERNAME")
36+
password = System.getenv("E_REPO_PASS")
37+
}
38+
}
39+
}
40+
}
41+
2442
tasks.getByName<Test>("test") {
2543
useJUnitPlatform()
2644
}

0 commit comments

Comments
 (0)