Skip to content

Commit

Permalink
Merge branch 'feature/refactor' into feature/poc
Browse files Browse the repository at this point in the history
 Conflicts:
	gradle.properties
	handlers/api/handlers.api
	http/http_handlers/api/http_handlers.api
	http/http_handlers/src/main/kotlin/com/hexagontk/http/handlers/HttpHandler.kt
	settings.gradle.kts
  • Loading branch information
jaguililla committed Oct 4, 2024
2 parents 768e9a8 + 4c04e1f commit aa4b4e0
Show file tree
Hide file tree
Showing 657 changed files with 6,841 additions and 5,597 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

on:
push:
branches-ignore: [ master ]
branches-ignore: [ main, release/** ]

permissions:
contents: read
Expand All @@ -11,3 +11,42 @@ jobs:
uses: hexagontk/.github/.github/workflows/graalvm_gradle.yml@master
with:
check_directory: core/build

# Jobs for debugging purposes, activate commenting 'if'
os_build:
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]

if: false
name: os_build (${{ matrix.os }})
uses: hexagontk/.github/.github/workflows/graalvm_gradle.yml@master
with:
os: ${{ matrix.os }}
check_directory: core/build

native_test:
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]

if: false
name: native_test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: al-cheb/configure-pagefile-action@v1.3
if: ${{ matrix.os == 'windows-latest' }}
with:
minimum-size: 16GB
disk-root: "C:"
- uses: actions/checkout@v4
with:
ref: develop
- uses: graalvm/setup-graalvm@v1
with:
java-version: 21
distribution: graalvm-community
cache: gradle
- run: ./gradlew --stacktrace nativeTest
8 changes: 5 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ permissions:
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v6
- uses: actions/stale@v9
with:
exempt-issue-labels: pinned
include-only-assigned: true
Expand Down Expand Up @@ -62,7 +64,7 @@ jobs:
with:
minimum-size: 16GB
disk-root: "C:"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: develop
- uses: graalvm/setup-graalvm@v1
Expand All @@ -81,7 +83,7 @@ jobs:
tasks: jmh

build_site:
uses: hexagontk/hexagon/.github/workflows/site.yml@master
uses: hexagontk/hexagon/.github/workflows/site.yml@main
with:
ref: develop

Expand Down
52 changes: 29 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@

on:
push:
branches: [ master ]
branches: [ main ]

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest
steps:

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mkdocs-${{ hashFiles('**/*.gradle*', '**/gradle*.properties') }}
restore-keys: ${{ runner.os }}-mkdocs-
path: |
~/.local/bin
~/.local/lib/python*/site-packages
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -27,26 +30,29 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: gradle

# TODO Check if JReleaser can push tags without an extra command
- env:
STAGING_DIRECTORY: build/staging
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export REMOTE="https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
git remote set-url origin "$REMOTE"
git clone "$REMOTE" --branch gh-pages build/gh-pages
./gradlew build
./gradlew -x build buildSite
ls -AlF site/build/site
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- env:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew --no-daemon -x test release

- run: |
cp -rf site/build/site/* build/gh-pages/
cd build/gh-pages
git add --all
git commit -m "Publishing to gh-pages"
git push origin gh-pages
SIGNING_KEY: ${{ secrets.HEXAGONTK_SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.HEXAGONTK_SIGNING_PASSWORD }}
REPOSITORY_USERNAME: ${{ secrets.HEXAGONTK_REPOSITORY_USERNAME }}
REPOSITORY_PASSWORD: ${{ secrets.HEXAGONTK_REPOSITORY_PASSWORD }}

JRELEASER_GPG_SECRET_KEY: ${{ secrets.HEXAGONTK_SIGNING_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.HEXAGONTK_SIGNING_PASSWORD }}
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.HEXAGONTK_REPOSITORY_USERNAME }}
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.HEXAGONTK_REPOSITORY_PASSWORD }}
run: |
export JRELEASER_GPG_PUBLIC_KEY="$(cat site/assets/project_hexagontk_com_public.key)"
./gradlew --no-daemon -x test publish
./gradlew --no-daemon -x test jreleaserFullRelease
git push --tags
build_site:
uses: hexagontk/hexagon/.github/workflows/site.yml@develop
needs: publish
with:
options: -P pushSite=true
29 changes: 0 additions & 29 deletions .github/workflows/release_branch.yml

This file was deleted.

22 changes: 15 additions & 7 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,26 @@ on:
description: Directory to check for build execution.
default: site/build/site

options:
type: string
description: Extra options for the 'buildSite' target.
default: ''

jobs:
site:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run: { shell: bash }
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mkdocs-${{ hashFiles('**/*.gradle*', '**/gradle*.properties') }}
restore-keys: ${{ runner.os }}-mkdocs-
path: |
~/.local/bin
~/.local/lib/python*/site-packages
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

Expand All @@ -54,9 +57,14 @@ jobs:
java-version: ${{ inputs.java }}
cache: gradle

- run: ./gradlew --stacktrace build

- run: ./gradlew --stacktrace -x build buildSite
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export GIT_COMMITTER_NAME="${GITHUB_ACTOR}"
export GIT_COMMITTER_EMAIL="project@hexagontk.com"
git fetch origin gh-pages --depth=1
./gradlew --stacktrace build
./gradlew --stacktrace -x build buildSite ${{ inputs.options }}
- if: ${{ inputs.check_directory != '' }}
run: ls -AlF "${{ inputs.check_directory }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ hs_err_pid*
# Other Tools
kotlin-js-store/
node_modules/
.kotlin/
.env

# System Files
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="https://hexagontk.com/jacoco">
<img src="https://hexagontk.com/img/coverage.svg" alt="Coverage" />
</a>
<a href="https://search.maven.org/search?q=g:com.hexagonkt">
<a href="https://search.maven.org/search?q=g:com.hexagontk">
<img src="https://hexagontk.com/img/download.svg" alt="Maven Central Repository" />
</a>
</p>
Expand Down Expand Up @@ -102,14 +102,14 @@ from scratch following these steps:
mavenCentral()
}
implementation("com.hexagonkt:http_server_jetty:$hexagonVersion")
implementation("com.hexagontk:http_server_jetty:$hexagonVersion")
```

* In Maven. Declare the dependency in `pom.xml`:

```xml
<dependency>
<groupId>com.hexagonkt</groupId>
<groupId>com.hexagontk</groupId>
<artifactId>http_server_jetty</artifactId>
<version>$hexagonVersion</version>
</dependency>
Expand All @@ -119,10 +119,10 @@ from scratch following these steps:

```kotlin
// hello_world
import com.hexagonkt.core.media.TEXT_PLAIN
import com.hexagonkt.http.model.ContentType
import com.hexagonkt.http.server.HttpServer
import com.hexagonkt.http.server.jetty.serve
import com.hexagontk.core.media.TEXT_PLAIN
import com.hexagontk.http.model.ContentType
import com.hexagontk.http.server.HttpServer
import com.hexagontk.http.server.jetty.serve

lateinit var server: HttpServer

Expand Down Expand Up @@ -154,7 +154,7 @@ fun main() {
<summary>Books Example</summary>

A simple CRUD example showing how to manage book resources. Here you can check the
[full test](http_test/src/main/kotlin/com/hexagonkt/http/test/examples/BooksTest.kt).
[full test](http_test/src/main/kotlin/com/hexagontk/http/test/examples/BooksTest.kt).

```kotlin
// books
Expand Down Expand Up @@ -211,7 +211,7 @@ private val path: PathHandler = path {
notFound("Book not found")
}

// Matches path's requests with *any* HTTP method as a fallback (return 404 instead 405)
// Matches path's requests with *any* HTTP method as a fallback (return 405 instead 404)
after(ALL - DELETE - PUT - GET, "/books/{id}", status = NOT_FOUND_404) {
send(METHOD_NOT_ALLOWED_405)
}
Expand All @@ -228,7 +228,7 @@ private val path: PathHandler = path {
<summary>Error Handling Example</summary>

Code to show how to handle callback exceptions and HTTP error codes. Here you can check the
[full test](http_test/src/main/kotlin/com/hexagonkt/http/test/examples/ErrorsTest.kt).
[full test](http_test/src/main/kotlin/com/hexagontk/http/test/examples/ErrorsTest.kt).

```kotlin
// errors
Expand Down Expand Up @@ -277,7 +277,7 @@ private val path: PathHandler = path {
<summary>Filters Example</summary>

This example shows how to add filters before and after route execution. Here you can check the
[full test](http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FiltersTest.kt).
[full test](http_test/src/main/kotlin/com/hexagontk/http/test/examples/FiltersTest.kt).

```kotlin
// filters
Expand Down Expand Up @@ -346,7 +346,7 @@ private val path: PathHandler = path {
<summary>Files Example</summary>

The following code shows how to serve resources and receive files. Here you can check the
[full test](http_test/src/main/kotlin/com/hexagonkt/http/test/examples/FilesTest.kt).
[full test](http_test/src/main/kotlin/com/hexagontk/http/test/examples/FilesTest.kt).

```kotlin
// files
Expand Down Expand Up @@ -461,7 +461,7 @@ be up-to-date of project's news following [@hexagontk] on X (Twitter).

Thanks to all project's [contributors]!

[![CodeTriage](https://www.codetriage.com/hexagonkt/hexagon/badges/users.svg)][CodeTriage]
[![CodeTriage](https://www.codetriage.com/hexagontk/hexagon/badges/users.svg)][CodeTriage]

[give it a star]: https://github.com/hexagontk/hexagon/stargazers
[discussions]: https://github.com/hexagontk/hexagon/discussions/categories/q-a
Expand Down
Loading

0 comments on commit aa4b4e0

Please sign in to comment.