Skip to content

Commit

Permalink
Merge ef71f6d into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 22, 2022
2 parents c2e86a4 + ef71f6d commit 74e9bb3
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 119 deletions.
73 changes: 58 additions & 15 deletions .github/workflows/gradle.g.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# 2022-10-20 22:36 | DO NOT EDIT. GENERATED BY ATOMATR
# 2022-10-23 02:03 | DO NOT EDIT. GENERATED BY ATOMATR
################################################################################

name: Gradle (by Atomatr)
Expand All @@ -13,7 +13,9 @@ on:

concurrency:
group: '${{ github.workflow }}
@ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
@ ${{ github.event.pull_request.head.label
|| github.head_ref
|| github.ref }}'
cancel-in-progress: true

jobs:
Expand All @@ -23,11 +25,18 @@ jobs:
steps:
- uses: actions/checkout@master

master-flag:
if: contains(github.event.head_commit.message, '!!master')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

unit-test:
timeout-minutes: 15

runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, 'Merge remote-tracking branch') }}
if: ${{ !contains(github.event.head_commit.message,
'Merge remote-tracking branch') }}

strategy:
matrix:
Expand Down Expand Up @@ -94,8 +103,9 @@ jobs:

- name: Set up Mavence
run: |
wget -O /tmp/mavence.jar https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar
java -jar /tmp/mavence.jar --version
wget -O ~/mavence.jar \
https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar
java -jar ~/mavence.jar --version
- name: Set up Python
uses: actions/setup-python@master
Expand All @@ -114,7 +124,7 @@ jobs:
version: ${{ steps.get_version.outputs.result }}
steps:
- uses: actions/checkout@master
- name: Setup JDK
- name: Setup JDK 8
uses: actions/setup-java@master
with:
java-version: '8'
Expand All @@ -126,6 +136,9 @@ jobs:
git fetch --all --tags
VERSION=$(./gradlew properties | grep version | awk '{print $2}')
echo "Version $VERSION"
[[ ! $A =~ .*SNAPSHOT.* ]]
[[ -z $(git tag -l $VERSION) ]]
echo "result=$VERSION" >>$GITHUB_OUTPUT
Expand All @@ -142,7 +155,7 @@ jobs:
target_branch: staging
github_token: ${{ github.token }}

to-master:
to-master-auto:
needs: [ to-github-release ]
runs-on: ubuntu-latest
steps:
Expand All @@ -154,6 +167,18 @@ jobs:
target_branch: master
github_token: ${{ github.token }}

to-master-manual:
needs: [ to-staging, master-flag ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Merge to master branch
uses: devmasx/merge-branch@v1.3.1
with:
type: now
target_branch: master
github_token: ${{ github.token }}

to-github-release:
needs: [ to-staging, release-flag, get-version-unique ]
runs-on: ubuntu-latest
Expand All @@ -168,27 +193,45 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check-can-publish-to-central:
needs: [release-flag]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Mavence
run: |
wget -O ~/mavence.jar \
https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar
java -jar ~/mavence.jar --version
- name: Check
run: java -jar ~/mavence.jar check-central
env:
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
MAVEN_GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

to-maven-central:
needs: [ to-github-release ]
needs: [ to-github-release, check-can-publish-to-central ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup JDK 8
- name: Setup JDK 17
uses: actions/setup-java@master
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Set up Mavence
run: |
wget -O /tmp/mavence.jar https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar
java -jar /tmp/mavence.jar --version
wget -O ~/mavence.jar \
https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar
java -jar ~/mavence.jar --version
- name: Publish to Maven Central
run: |
java -jar /tmp/mavence.jar central
java -jar ~/mavence.jar central
env:
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
MAVEN_GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
70 changes: 6 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,77 +33,19 @@ Most of the functions use "second-order iterative Kahan–Babuška algorithm"
by [Klein (2005)](https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.582.288&rep=rep1&type=pdf)
.

# Install

<details><summary>Install from Maven Central with Gradle</summary>

### build.gradle.kts (Gradle/Kotlin)

```kotlin
repositories {
mavenCentral()
}

dependencies {
implementation("io.github.rtmigo:precise:0.1.0")
}
```

or

### build.gradle (Gradle/Groovy)

```groovy
repositories {
mavenCentral()
}
dependencies {
implementation "io.github.rtmigo:precise:0.1.0"
}
```

</details>

<details><summary>Install from Maven Central with Maven</summary>

## Maven

```xml
<dependencies>
<dependency>
<groupId>io.github.rtmigo</groupId>
<artifactId>precise</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
```

</details>

<details><summary>Install latest from GitHub with Gradle/Kotlin</summary>

#### settings.gradle.kts
# Install [![Maven Central](https://img.shields.io/maven-central/v/io.github.rtmigo/precise.svg)](https://search.maven.org/artifact/io.github.rtmigo/precise)

```kotlin
sourceControl {
gitRepository(java.net.URI("https://github.com/rtmigo/precise_kt.git")) {
producesModule("io.github.rtmigo:precise")
}
}
```

#### build.gradle.kts
// build.gradle.kts

```kotlin
dependencies {
implementation("io.github.rtmigo:precise") {
version { branch = "staging" }
}
implementation("io.github.rtmigo:precise:X.X.X")
// replace X.X.X with actual version
}
```

</details>
Find the latest version and instructions for other build systems
at [Maven Central](https://search.maven.org/artifact/io.github.rtmigo/precise).


# Lambda functions
Expand Down
30 changes: 8 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ publishing {
pom {
val repo = "precise_kt"
name.set("precise")
description.set("Kotlin/JVM compensated summation of Double sequences to calculate sum, mean, standard deviation")
description.set("Kotlin/JVM compensated summation of Double " +
"sequences to calculate sum, mean, standard deviation")
url.set("https://github.com/rtmigo/$repo")
developers {
developer {
Expand All @@ -25,6 +26,11 @@ publishing {
}
}

organization {
this.name.set("Revercode")
this.url.set("https://revercode.com")
}

scm {
connection.set("scm:git://github.com/rtmigo/$repo.git")
url.set("https://github.com/rtmigo/$repo")
Expand All @@ -40,16 +46,8 @@ publishing {
}
}

//signing {
// useInMemoryPgpKeys(signingKey, signingPassword)
// sign(central)
//}




group = "io.github.rtmigo"
version = "0.1.0-dev25"
version = "0.1.0"

java {
withSourcesJar() // для Maven Central
Expand Down Expand Up @@ -79,15 +77,3 @@ kotlin {
tasks.test {
useJUnitPlatform()
}


tasks.register<Jar>("uberJar") {
archiveClassifier.set("uber")
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }
.map { zipTree(it) }
})
}
22 changes: 4 additions & 18 deletions test_as_maven_package.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import json
import os.path
import subprocess
#from pathlib import Path

#import time
#from rtmaven import prepare, stage, promote, Package, eprint, eprint_header
from tempground import TempGround


Expand Down Expand Up @@ -50,20 +47,9 @@ def test_package(maven_url: str, ver: str):


def build_test_release():
js = json.loads(subprocess.check_output(
["java", "-jar", "/tmp/mavence.jar", "local"]))
test_package(js["mavenRepo"], js["version"])
# package = stage(prepare(
# description="Kotlin/JVM compensated summation of Double sequences "
# "to calculate sum, mean, standard deviation",
# github_url="https://github.com/rtmigo/precise_kt@master",
# developer="Artsiom iG <ortemeo@gmail.com>",
# license="MIT"))
#
# eprint_header("Testing")
# eprint()
# test_package(package)
# promote(package)
outp = json.loads(subprocess.check_output(
["java", "-jar", os.path.expanduser("~/mavence.jar"), "local"]))
test_package(outp["mavenRepo"], outp["version"])


if __name__ == "__main__":
Expand Down

0 comments on commit 74e9bb3

Please sign in to comment.