Further testing tags

This commit is contained in:
Sebastian Hartte
2020-08-15 18:42:20 +02:00
parent 11d772a32b
commit 011455e327
4 changed files with 49 additions and 22 deletions
+4 -5
View File
@@ -23,8 +23,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- name: Build with Gradle
run: ./gradlew build
- name: Publish Snapshot
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/fabric/master'
- uses: actions/upload-artifact@v2
with:
name: dist
path: build/libs/
+9 -6
View File
@@ -10,12 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Validate semver
- name: Export current tag as environment variable
env:
TAG: ${{ github.event.ref }}
run: |
echo $TAG | grep -oP '^fabric/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-]+)*))?$'
echo "::set-env name=RELEASE::${TAG:1}"
run: echo "::set-env name=TAG::${TAG}"
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
@@ -29,12 +27,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew generateData build
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: build/libs/
- name: Publish to github packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publish
run: echo "./gradlew publish"
- name: Upload to curseforge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE: ${{ secrets.CURSEFORGE }}
run: ./gradlew curseforge
run: echo "./gradlew curseforge"
+35 -10
View File
@@ -60,6 +60,29 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// Create version number
ext.pr = System.getenv('PR_NUMBER') ?: ""
if (ext.pr) {
version = version + "+pr." + ext.pr
}
ext.branch = System.getenv('BRANCH') ?: ""
if (ext.branch) {
version = version + "+branch." + ext.branch
}
ext.tag = System.getenv('TAG') ?: ""
if (ext.tag && ext.tag.startsWith("fabric/v")) {
version = ext.tag.substring("fabric/v".length())
// Validate that the rest is a semver version
if (version ==~ /^(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-]+)*))?$/) {
println("::set-env name=VERSION::${version}")
} else {
throw new GradleException("Invalid semver: $version")
}
}
// Maven group and artifact name
group = artifact_group
archivesBaseName = artifact_basename
@@ -151,17 +174,19 @@ processResources {
apply from: 'gradle/scripts/artifacts.gradle'
apply from: 'gradle/scripts/curseforge.gradle'
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'appliedenergistics2-fabric'
if (!version.endsWith("-SNAPSHOT")) {
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'appliedenergistics2-fabric'
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ if (isAlpha) {
cfReleaseType = "beta"
}
if (System.getenv("CURSEFORGE")) {
if (System.getenv("CURSEFORGE") && !version.endsWith("-SNAPSHOT")) {
curseforge {
apiKey = System.getenv("CURSEFORGE")
project {