Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jun 5, 2024
1 parent 7d701fc commit 894e458
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Release
on:
release:
types: [ created ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Publish
run: ./gradlew publish -Pmvn.user=${{ secrets.MAVEN_USER }} -Pmvn.key=${{ secrets.MAVEN_TOKEN }}

- uses: actions/upload-artifact@v2
with:
name: Artifacts
path: ./build/libs/
30 changes: 30 additions & 0 deletions .github/workflows/build_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Snapshot

on:
push:
branches-ignore:
- 'feature/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Publish
run: ./gradlew publish -Pversion_snapshot -Pmvn.user=${{ secrets.MAVEN_USER }} -Pmvn.key=${{ secrets.MAVEN_TOKEN }} -x test

- uses: actions/upload-artifact@v2
with:
name: Snapshot Artifacts
path: ./build/libs/
22 changes: 21 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import java.net.URI

plugins {
kotlin("jvm") version "1.9.22"
`java-gradle-plugin`
`maven-publish`
}

group = "xyz.wagyourtail.unimined.expect-platform"
version = "1.0-SNAPSHOT"
version = if (project.hasProperty("version_snapshot")) project.properties["version"] as String + "-SNAPSHOT" else project.properties["version"] as String

base {
archivesName.set("expect-platform")
Expand All @@ -19,6 +21,10 @@ java {

withJavadocJar()
withSourcesJar()

toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

repositories {
Expand Down Expand Up @@ -76,6 +82,20 @@ gradlePlugin {
}

publishing {
repositories {
maven {
name = "WagYourMaven"
url = if (project.hasProperty("version_snapshot")) {
URI.create("https://maven.wagyourtail.xyz/snapshots/")
} else {
URI.create("https://maven.wagyourtail.xyz/releases/")
}
credentials {
username = project.findProperty("mvn.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("mvn.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("mavenJava") {
groupId = "xyz.wagyourtail.unimined.expect-platform"
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
kotlin.code.style=official

version = 1.0.0

asmVersion=9.7

0 comments on commit 894e458

Please sign in to comment.