mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-11 16:07:48 +00:00
update buildscript for deployment
This commit is contained in:
2 files changed
+28
-12
No files matched your search
@@ -11,6 +11,9 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }}
|
||||
MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
@@ -42,4 +45,7 @@ jobs:
|
||||
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
|
||||
prerelease: false
|
||||
title: "${{ env.RELEASE_VERSION }}"
|
||||
files: build/libs/*.jar
|
||||
files: build/libs/*.jar
|
||||
|
||||
- name: Publish to maven
|
||||
run: ./gradlew publish
|
||||
+21
-11
@@ -1,4 +1,4 @@
|
||||
//version: 1641429628falsepattern12
|
||||
//version: 1641429628falsepattern16
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
|
||||
@@ -545,8 +545,16 @@ def getCredentials = {
|
||||
return [username: entry.username.text(), password: entry.password.text()]
|
||||
}
|
||||
}
|
||||
throw new Exception();
|
||||
} catch (Exception ignored) {
|
||||
return [username: "none", password: "none"]
|
||||
//Try from environment variables if file does not exist
|
||||
String username = System.getenv("MAVEN_DEPLOY_USER")
|
||||
String password = System.getenv("MAVEN_DEPLOY_PASSWORD")
|
||||
if (username == null || password == null) {
|
||||
return [username: null, password: null]
|
||||
} else {
|
||||
return [username: username, password: password]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -554,9 +562,9 @@ def getCredentials = {
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifact source: jar
|
||||
artifact source: (jar.enabled ? jar : shadowJar)
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
artifact source: devJar, classifier: "dev"
|
||||
artifact source: (devJar.enabled ? devJar : shadowDevJar), classifier: "dev"
|
||||
if (apiPackage) {
|
||||
artifact source: apiJar, classifier: "api"
|
||||
}
|
||||
@@ -568,13 +576,15 @@ publishing {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = repositoryName
|
||||
url = repositoryURL
|
||||
def creds = getCredentials()
|
||||
credentials {
|
||||
username = creds == null ? "none" : creds.username
|
||||
password = creds == null ? "none" : creds.password
|
||||
if (repositoryURL.trim() != "") {
|
||||
maven {
|
||||
name = repositoryName
|
||||
url = repositoryURL
|
||||
def creds = getCredentials()
|
||||
credentials {
|
||||
username = creds == null ? "none" : creds.username
|
||||
password = creds == null ? "none" : creds.password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user