Skip to content

Commit 15b4619

Browse files
committed
Add actions and publish
1 parent fe2d369 commit 15b4619

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java#publishing-using-gradle
3+
4+
name: Gradle Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up JDK 1.8
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 1.8
21+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
22+
settings-path: ${{ github.workspace }} # location for the settings.xml file
23+
24+
- name: Grant execute permission for gradlew
25+
run: chmod +x gradlew
26+
- name: Build with Gradle
27+
run: ./gradlew build --info
28+
29+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
30+
# the publishing section of your build.gradle
31+
- name: Publish to Maven
32+
run: ./gradlew publish
33+
env:
34+
USERNAME: ${{ secrets.MESMERIZE_CI_USER }}
35+
TOKEN: ${{ secrets.MESMERIZE_CI_TOKEN }}

.github/workflows/gradle.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ '**' ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 1.8
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 1.8
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
- name: Build with Gradle
26+
run: ./gradlew build --info

build.gradle

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
plugins {
22
id 'java'
33
id "io.izzel.taboolib" version "1.2" apply false
4+
id 'maven-publish'
45
}
56

67
group 'io.izzel.mesmerize'
7-
version = '1.3.0'
8+
version = '1.3.1'
89

910
sourceCompatibility = 1.8
1011
targetCompatibility = 1.8
@@ -64,4 +65,23 @@ task apiJar(type: Jar) {
6465
from sourceSets.api.output
6566
}
6667

67-
jar.dependsOn(apiJar)
68+
jar.dependsOn(apiJar)
69+
70+
publishing {
71+
repositories {
72+
maven {
73+
name = "IzzelAliz Repo"
74+
url = uri('https://maven.izzel.io/' + (project.version.toString().endsWith('SNAPSHOT') ? 'snapshots' : 'releases'))
75+
credentials {
76+
username = project.findProperty("mavenUser") ?: System.getenv("USERNAME")
77+
password = project.findProperty("mavenToken") ?: System.getenv("TOKEN")
78+
}
79+
}
80+
}
81+
publications {
82+
mavenJava(MavenPublication) {
83+
artifact apiJar
84+
artifact jar
85+
}
86+
}
87+
}

0 commit comments

Comments
 (0)