Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_size = 2
ij_continuation_indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{kt, kts}]
ij_kotlin_imports_layout = *
35 changes: 35 additions & 0 deletions .github/renovate.json5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL json5

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:recommended',
],
packageRules: [
// First release used Kotlin version + project version which sorts higher than new versions.
{
matchPackageNames: [
'co.touchlab:cklib-gradle-plugin',
],
allowedVersions: '!/1\\.5\\.31\\.2/',
},
],
ignorePresets: [
// Ensure we get the latest version and are not pinned to old versions.
'workarounds:javaLTSVersions',
],
customManagers: [
// Update .java-version file with the latest JDK version.
{
customType: 'regex',
fileMatch: [
'\\.java-version$',
],
matchStrings: [
'(?<currentValue>.*)\\n',
],
datasourceTemplate: 'java-version',
depNameTemplate: 'java',
// Only write the major version.
extractVersionTemplate: '^(?<version>\\d+)',
},
]
}
1 change: 1 addition & 0 deletions .github/workflows/.java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
109 changes: 109 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: build

on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- 'main'
tags-ignore:
- '**'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
zig:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: mlugg/setup-zig@v2
with:
version: 0.14.0

- run: zig build -p src/jvmMain/resources/jni
working-directory: okio-zstd

- uses: actions/upload-artifact@v4
with:
name: jni-binaries
path: okio-zstd/src/jvmMain/resources/jni
if-no-files-found: error

platform-tests:
needs:
- zig
strategy:
fail-fast: false
matrix:
platform:
- os: macos-latest

runs-on: ${{ matrix.platform.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.java-version

- uses: actions/download-artifact@v4
with:
name: jni-binaries
path: okio-zstd/src/jvmMain/resources/jni

- run: ./gradlew jvmTest apiCheck --stacktrace

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-report-${{ matrix.platform.os }}
path: '**/build/reports/tests/**'
retention-days: 1

build:
runs-on: macos-latest
needs:
- platform-tests

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.java-version

- uses: actions/download-artifact@v4
with:
name: jni-binaries
path: okio-zstd/src/jvmMain/resources/jni

- run: ./gradlew assemble :dokkaHtmlMultiModule

- uses: actions/upload-artifact@v4
with:
name: html-docs
path: build/dokka/htmlMultiModule/
if-no-files-found: error

- run: ./gradlew publishToMavenCentral
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'square/okio-zstd' }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

- name: Deploy docs to website
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'square/okio-zstd' }}
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: site
FOLDER: build/dokka/htmlMultiModule/
TARGET_FOLDER: docs/latest/
CLEAN: true
15 changes: 15 additions & 0 deletions .github/workflows/gradle-wrapper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: gradle-wrapper

on:
pull_request:
paths:
- 'gradlew'
- 'gradlew.bat'
- 'gradle/wrapper/**'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release

on:
push:
tags:
- '**'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
publish:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.java-version

- uses: mlugg/setup-zig@v2
with:
version: 0.14.0

- run: zig build -p src/jvmMain/resources/jni
working-directory: okio-zstd

- run: ./gradlew publishToMavenCentral :dokkaHtmlMultiModule
if: ${{ github.repository == 'square/okio-zstd' }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

- uses: ffurrer2/extract-release-notes@v2
id: release_notes

- name: Deploy docs to website
if: ${{ github.repository == 'square/okio-zstd' }}
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: site
FOLDER: build/dokka/htmlMultiModule/
TARGET_FOLDER: docs/1.x/
CLEAN: true
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# IntelliJ IDEA
.idea
!/.idea/copyright
*.iml

# Gradle
.gradle
build/
local.properties
reports
jacoco.exec
.externalNativeBuild
.cxx
.kotlin

# iOS
*.pbxuser
# Ignore generated Xcode projects
*.xcworkspace
xcuserdata
Pods

# Release
docs/0.x

# Zig
.zig-cache
zig-out

# Binaries
okio-zstd/src/jvmMain/resources/jni/**/*.dylib
okio-zstd/src/jvmMain/resources/jni/**/*.so
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "zstd"]
path = zstd
url = https://github.com/facebook/zstd.git
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Change Log

## Unreleased

Loading