Added release task (#4423)
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
name: 'Release'
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Validate semver
|
||||||
|
env:
|
||||||
|
RELEASE: ${{ github.event.release.tag_name }}
|
||||||
|
run: echo $RELEASE | grep -oP '^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 1.8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Use gradle cache for faster builds
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/caches
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||||
|
- name: Generate assets
|
||||||
|
uses: GabrielBB/xvfb-action@v1.2
|
||||||
|
env:
|
||||||
|
RELEASE: ${{ github.event.release.tag_name }}
|
||||||
|
with:
|
||||||
|
run: ./gradlew runData --no-daemon
|
||||||
|
- name: Build with Gradle
|
||||||
|
env:
|
||||||
|
RELEASE: ${{ github.event.release.tag_name }}
|
||||||
|
run: ./gradlew build --no-daemon
|
||||||
|
- name: Publish package
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
RELEASE: ${{ github.event.release.tag_name }}
|
||||||
|
run: ./gradlew publish --no-daemon
|
||||||
@@ -28,6 +28,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id "maven-publish"
|
||||||
id "com.diffplug.gradle.spotless" version "4.3.0"
|
id "com.diffplug.gradle.spotless" version "4.3.0"
|
||||||
id "org.sonarqube" version "2.8"
|
id "org.sonarqube" version "2.8"
|
||||||
id "jacoco"
|
id "jacoco"
|
||||||
@@ -66,6 +67,12 @@ if (ext.branch) {
|
|||||||
version = version + "+branch." + ext.branch
|
version = version + "+branch." + ext.branch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext.release = System.getenv('RELEASE') ?: ""
|
||||||
|
if (ext.release) {
|
||||||
|
version = ext.release.substring(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Maven group and artifact name
|
// Maven group and artifact name
|
||||||
group = artifact_group
|
group = artifact_group
|
||||||
archivesBaseName = artifact_basename
|
archivesBaseName = artifact_basename
|
||||||
@@ -136,3 +143,24 @@ minecraft {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apply from: 'gradle/scripts/artifacts.gradle'
|
apply from: 'gradle/scripts/artifacts.gradle'
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
maven(MavenPublication) {
|
||||||
|
groupId = project.group
|
||||||
|
artifactId = project.archivesBaseName
|
||||||
|
version = project.version
|
||||||
|
from components.java
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
credentials {
|
||||||
|
username System.getenv("GITHUB_ACTOR")
|
||||||
|
password System.getenv("GITHUB_TOKEN")
|
||||||
|
}
|
||||||
|
name = "GitHubPackages"
|
||||||
|
url = "https://maven.pkg.github.com/AppliedEnergistics/Applied-Energistics-2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task javadocs(type: Javadoc) {
|
task javadocs(type: Javadoc) {
|
||||||
|
classpath = sourceSets.main.compileClasspath
|
||||||
source = sourceSets.api.java
|
source = sourceSets.api.java
|
||||||
include "appeng/api/**"
|
include "appeng/api/**"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user