diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a362884..25f2cfd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,16 +4,33 @@ on: [ push ] jobs: build: - - runs-on: ubuntu-latest - + strategy: + matrix: + os: [ macOS-latest, windows-latest ] + runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - name: Checkout the repo + uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build + - name: Add msys to path + if: matrix.os == 'windows-latest' + run: SETX PATH "%PATH%;C:\msys64\mingw64\bin" + - name: Cache gradle + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Cache konan + uses: actions/cache@v2 + with: + path: ~/.konan + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Build + run: ./gradlew build --no-daemon --stacktrace diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0fbf9c1e..165912e2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,40 +1,57 @@ -name: Bintray Publish +name: Gradle publish on: + workflow_dispatch: release: types: - created jobs: - build-on-windows: - runs-on: windows-latest + publish: + environment: + name: publish + strategy: + matrix: + os: [macOS-latest, windows-latest] + runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - name: Checkout the repo + uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Gradle clean - run: ./gradlew clean - - name: Gradle build - run: ./gradlew build - - name: Run release task - run: ./gradlew release -PbintrayUser=${{ secrets.BINTRAY_USER }} -PbintrayApiKey=${{ secrets.BINTRAY_KEY }} - build-on-macos: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Add msys to path + if: matrix.os == 'windows-latest' + run: SETX PATH "%PATH%;C:\msys64\mingw64\bin" + - name: Cache gradle + uses: actions/cache@v2 with: - java-version: 11 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Gradle clean - run: ./gradlew clean - - name: Gradle build - run: ./gradlew build - - name: Run release task - run: ./gradlew release -PbintrayUser=${{ secrets.BINTRAY_USER }} -PbintrayApiKey=${{ secrets.BINTRAY_KEY }} + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Cache konan + uses: actions/cache@v2 + with: + path: ~/.konan + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Publish Windows Artifacts + if: matrix.os == 'windows-latest' + run: > + ./gradlew release --no-daemon + -Ppublishing.github.user=${{ secrets.PUBLISHING_GITHUB_USER }} + -Ppublishing.github.token=${{ secrets.PUBLISHING_GITHUB_TOKEN }} + -Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }} + -Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }} + - name: Publish Mac Artifacts + if: matrix.os == 'macOS-latest' + run: > + ./gradlew release --no-daemon + -Ppublication.platform=macosX64 + -Ppublishing.github.user=${{ secrets.PUBLISHING_GITHUB_USER }} + -Ppublishing.github.token=${{ secrets.PUBLISHING_GITHUB_TOKEN }} + -Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }} + -Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 5363ed99..27f40ae9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ allprojects { } subprojects { - apply(plugin = "ru.mipt.npm.gradle.publish") + apply(plugin = "maven-publish") repositories { maven("https://dl.bintray.com/mipt-npm/kscience") maven("https://dl.bintray.com/mipt-npm/dev") @@ -20,9 +20,9 @@ readme { } ksciencePublish { - bintrayRepo = "dataforge" - githubProject = "dataforge-core" - spaceRepo = "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven" + github("dataforge-core") + space("https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven") + sonatype() } apiValidation { diff --git a/settings.gradle.kts b/settings.gradle.kts index 8483876d..f4120248 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,7 +6,7 @@ pluginManagement { maven("https://dl.bintray.com/kotlin/kotlin-eap") } - val toolsVersion = "0.8.4" + val toolsVersion = "0.9.0" val kotlinVersion = "1.4.31" plugins {