Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
BppleMan committed Jul 24, 2024
2 parents a9a317e + 7b73a5c commit de324ad
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 206 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/gradle-publish.yml

This file was deleted.

109 changes: 0 additions & 109 deletions .github/workflows/gradle.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/kommand publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Kommand Publish

on:
push:
tags:
- "*"
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
runs-on: macos-12
steps:
- uses: actions/checkout@v4

- name: Set up Cargo
uses: actions-rust-lang/[email protected]
with:
toolchain: 1.69.0
target: ${{ matrix.cargo_target }}

- name: Set up just
run: cargo install just --version 1.15.0

- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'microsoft'
architecture: ${{ matrix.jdk_arch }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Set up cross-compiler
run: just prepare

- name: Build kommand-core
run: just all
working-directory: kommand-core

- name: Test memory leak
run: just leaks

- name: Import GPG key
run: |
mkdir -p $HOME/.gradle
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode > $HOME/.gradle/secret.gpg
gpg --batch --import $HOME/.gradle/secret.gpg
- name: Publish to sonatype
run: |
./gradlew publishToSonatype \
-PossrhUsername="${{ secrets.SONATYPE_USERNAME }}" \
-PossrhPassword="${{ secrets.SONATYPE_PASSWORD }}" \
-Psigning.keyId="${{ secrets.GPG_KEY_ID }}" \
-Psigning.password="${{ secrets.GPG_PASSPHRASE }}" \
-Psigning.secretKeyRingFile="$HOME/.gradle/secret.gpg"
- name: Close sonatype
run: |
./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository \
-PossrhUsername="${{ secrets.SONATYPE_USERNAME }}" \
-PossrhPassword="${{ secrets.SONATYPE_PASSWORD }}" \
-Psigning.keyId="${{ secrets.GPG_KEY_ID }}" \
-Psigning.password="${{ secrets.GPG_PASSPHRASE }}" \
-Psigning.secretKeyRingFile="$HOME/.gradle/secret.gpg"
- name: Release sonatype
run: |
./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository \
-PossrhUsername="${{ secrets.SONATYPE_USERNAME }}" \
-PossrhPassword="${{ secrets.SONATYPE_PASSWORD }}" \
-Psigning.keyId="${{ secrets.GPG_KEY_ID }}" \
-Psigning.password="${{ secrets.GPG_PASSPHRASE }}" \
-Psigning.secretKeyRingFile="$HOME/.gradle/secret.gpg"
- name: Clean up GPG key
if: always()
run: |
rm -f $HOME/.gradle/secret.gpg
gpg --batch --yes --delete-secret-keys ${{ secrets.GPG_KEY_ID }}
gpg --batch --yes --delete-keys ${{ secrets.GPG_KEY_ID }}
105 changes: 105 additions & 0 deletions .github/workflows/kommand test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Kommand Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
kommand-test:
strategy:
fail-fast: false
matrix:
platform:
- macos
- linux
- windows
arch:
- x64
- aarch64
exclude:
- platform: windows
arch: aarch64
include:
- platform: macos
arch: x64
os: macos-12
cargo_target: x86_64-apple-darwin
task: macosX64Test
jdk_arch: x64
- platform: macos
arch: aarch64
os: macos-14
cargo_target: aarch64-apple-darwin
task: macosArm64Test
jdk_arch: aarch64
- platform: linux
arch: x64
os: ubuntu-22.04
cargo_target: x86_64-unknown-linux-gnu
task: linuxX64Test
jdk_arch: x64
- platform: linux
arch: aarch64
os: ubuntu-22.04
cargo_target: aarch64-unknown-linux-gnu
task: linuxArm64TestDocker
jdk_arch: x64
- platform: windows
arch: x64
os: windows-latest
cargo_target: x86_64-pc-windows-gnu
task: mingwX64Test
jdk_arch: x64

name: ${{ matrix.os }} - ${{ matrix.cargo_target }} - ${{ matrix.task }}

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Cargo
uses: actions-rust-lang/[email protected]
with:
toolchain: 1.69.0
target: ${{ matrix.cargo_target }}

- name: Set up just
run: cargo install just --version 1.15.0

- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'microsoft'
architecture: ${{ matrix.jdk_arch }}

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- if: ${{ matrix.platform == 'linux' && matrix.arch == 'aarch64' }}
name: Set up cross-gcc
run: sudo apt-get install -y gcc-aarch64-linux-gnu

- if: ${{ matrix.platform == 'linux' && matrix.arch == 'aarch64' }}
name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build kommand-core
run: just ${{ matrix.cargo_target }}
working-directory: ./kommand-core

- name: Running Test
run: just ${{ matrix.task }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Kommand Publish](https://github.com/kgit2/kommand/actions/workflows/gradle-publish.yml/badge.svg)](https://github.com/kgit2/kommand/actions/workflows/gradle-publish.yml)
[![Kommand Test](https://github.com/kgit2/kommand/actions/workflows/gradle.yml/badge.svg?branch=test)](https://github.com/kgit2/kommand/actions/workflows/gradle.yml)
[![Kommand Publish](https://github.com/kgit2/kommand/actions/workflows/kommand%20publish.yml/badge.svg?branch=main)](https://github.com/kgit2/kommand/actions/workflows/kommand%20publish.yml)
[![Kommand Test](https://github.com/kgit2/kommand/actions/workflows/kommand%20test.yml/badge.svg?branch=main)](https://github.com/kgit2/kommand/actions/workflows/kommand%20test.yml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.kgit2/kommand/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.kgit2/kommand)


Expand All @@ -11,7 +11,7 @@

Kotlin Native library for create sub-process and redirect their I/O.

# v2.0.0
# v2.1.1

Rust is an excellent language that takes into account both performance and engineering.

Expand Down
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.kgit2"
version = "2.1.0"
version = "2.1.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -82,6 +82,8 @@ kotlin {
}
}

val testString: String by project

tasks {
withType(Wrapper::class) {
distributionType = Wrapper.DistributionType.ALL
Expand All @@ -93,6 +95,12 @@ tasks {
showStandardStreams = true
}
}

val testArg by creating {
doLast {
println(testString)
}
}
}

val ossrhUrl: String = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
kotlin.code.style=official

org.gradle.jvmargs=-Xmx4096m
#org.gradle.caching=true
kotlin.mpp.enableCInteropCommonization=true
Loading

0 comments on commit de324ad

Please sign in to comment.