Skip to content

Commit 493047d

Browse files
committed
set up releases
1 parent 3b6506f commit 493047d

File tree

20 files changed

+236
-88
lines changed

20 files changed

+236
-88
lines changed

.github/settings.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
4+
<servers>
5+
<server>
6+
<id>ossrh</id>
7+
<username>${env.OSSRH_USERNAME}</username>
8+
<password>${env.OSSRH_PASSWORD}</password>
9+
</server>
10+
</servers>
11+
12+
<profiles>
13+
<profile>
14+
<id>ossrh</id>
15+
<activation>
16+
<activeByDefault>true</activeByDefault>
17+
</activation>
18+
<properties>
19+
<gpg.executable>gpg</gpg.executable>
20+
<gpg.keyname>${env.GPG_KEY_ID}</gpg.keyname>
21+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
22+
<gpg.useAgent>true</gpg.useAgent>
23+
</properties>
24+
</profile>
25+
</profiles>
26+
</settings>

.github/workflows/build-matrix.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
java_version: [1.8, 11, 15, 17]
11+
java_version: [11, 17]
1212
os: [ubuntu-latest, windows-latest, macOS-latest]
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
1717
- name: Mustache Specs
1818
run: |
1919
git submodule update --init --recursive
2020
- name: Set up JDK ${{ matrix.java_version }}
21-
uses: actions/setup-java@b6e674f4b717d7b0ae3baee0fbe79f498905dfde
21+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
2222
with:
2323
java-version: ${{ matrix.java_version }}
24+
distribution: "temurin"
25+
cache: maven
2426
- name: Install
2527
run: mvn clean install -DskipTests --batch-mode --no-transfer-progress
2628
env:

.github/workflows/release.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags:
9+
- "v*"
10+
workflow_dispatch:
11+
12+
jobs:
13+
publish:
14+
name: Publish
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
20+
with:
21+
fetch-depth: 0 # Important for versioning extension to work correctly
22+
23+
- name: Set up JDK 11
24+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
25+
with:
26+
java-version: 11
27+
distribution: "temurin"
28+
cache: maven
29+
30+
- name: Install GPG key
31+
run: |
32+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --import
33+
gpg --list-secret-keys --keyid-format LONG
34+
35+
- name: Set release type
36+
id: release_type
37+
run: |
38+
echo "GitHub ref: $GITHUB_REF"
39+
if [[ $GITHUB_REF == refs/tags/v* ]]; then
40+
echo "IS_RELEASE=true" >> $GITHUB_ENV
41+
echo "This is a release build from tag ${GITHUB_REF#refs/tags/}"
42+
else
43+
echo "IS_RELEASE=false" >> $GITHUB_ENV
44+
echo "This is a snapshot build from branch ${GITHUB_REF#refs/heads/}"
45+
fi
46+
47+
- name: Build code
48+
run: mvn clean verify -DskipTests
49+
50+
- name: Deploy to Maven Central
51+
run: |
52+
if [[ $IS_RELEASE == true ]]; then
53+
echo "Deploying release to Maven Central"
54+
mvn deploy -P sonatype -DskipTests \
55+
-s ${{ github.workspace }}/.github/settings.xml
56+
else
57+
echo "Deploying snapshot to Maven Central"
58+
mvn deploy -DskipTests \
59+
-s ${{ github.workspace }}/.github/settings.xml
60+
fi
61+
env:
62+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
63+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
64+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
65+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
66+
VERSIONING_EXTENSION_LOG: true

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ pom.xml.versionsBackup
2424
jacoco.exec
2525

2626
out
27+
28+
# VSCode
29+
.vscode
30+
31+
.git-versioned-pom.xml

.java-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11

.mvn/extensions.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>me.qoomon</groupId>
5+
<artifactId>maven-git-versioning-extension</artifactId>
6+
<version>9.10.2</version>
7+
</extension>
8+
</extensions>
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<configuration xmlns="https://github.com/qoomon/maven-git-versioning-extension"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="https://github.com/qoomon/maven-git-versioning-extension https://qoomon.github.io/maven-git-versioning-extension/configuration-9.4.0.xsd">
4+
5+
<refs considerTagsOnBranches="true">
6+
<ref type="tag">
7+
<pattern><![CDATA[v(?<version>.*)]]></pattern>
8+
<version>${ref.version}</version>
9+
</ref>
10+
<ref type="branch">
11+
<pattern>.+</pattern>
12+
<version>${describe.tag.version}+${describe.distance}-${commit.short}-SNAPSHOT</version>
13+
</ref>
14+
</refs>
15+
16+
<preferTags>true</preferTags>
17+
18+
<!-- optional fallback configuration in case of no matching ref configuration-->
19+
<rev>
20+
<version>${commit}</version>
21+
</rev>
22+
</configuration>

README.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Become a Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://patreon.com/edgarespina)
2-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars)
3-
[![javadoc](https://javadoc.io/badge/com.github.jknack/handlebars.svg)](https://javadoc.io/doc/com.github.jknack/handlebars)
2+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.iterable/handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.iterable/handlebars)
3+
[![javadoc](https://javadoc.io/badge/com.iterable/handlebars.svg)](https://javadoc.io/doc/com.iterable/handlebars)
44

55
Handlebars.java
66
===============
@@ -33,15 +33,15 @@ Handlebars provides the power necessary to let you build semantic templates effe
3333
# Getting Started
3434
In general, the syntax of **Handlebars** templates is a superset of [Mustache](https://mustache.github.io) templates. For basic syntax, check out the [Mustache manpage](https://mustache.github.io).
3535

36-
The [Handlebars.java blog](https://jknack.github.io/handlebars.java) is a good place for getting started too. Javadoc is available at [javadoc.io](https://javadoc.io/doc/com.github.jknack/handlebars).
36+
The [Handlebars.java blog](https://jknack.github.io/handlebars.java) is a good place for getting started too. Javadoc is available at [javadoc.io](https://javadoc.io/doc/com.iterable/handlebars).
3737

3838
## Maven
39-
#### Stable version: [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars)
39+
#### Stable version: [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.iterable/handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.iterable/handlebars)
4040

4141

4242
```xml
4343
<dependency>
44-
<groupId>com.github.jknack</groupId>
44+
<groupId>com.iterable</groupId>
4545
<artifactId>handlebars</artifactId>
4646
<version>${handlebars-version}</version>
4747
</dependency>
@@ -51,7 +51,7 @@ Handlebars provides the power necessary to let you build semantic templates effe
5151
Templates are loaded using the ```TemplateLoader``` class. Handlebars.java provides three implementations of a ```TemplateLoader```:
5252
* ClassPathTemplateLoader (default)
5353
* FileTemplateLoader
54-
* SpringTemplateLoader (see the [handlebars-springmvc](https://github.com/jknack/handlebars.java/tree/master/handlebars-springmvc) module)
54+
* SpringTemplateLoader (see the [handlebars-springmvc](https://github.com/iterable/handlebars.java/tree/master/handlebars-springmvc) module)
5555

5656
This example loads ```mytemplate.hbs``` from the root of the classpath:
5757

@@ -112,7 +112,7 @@ Download from Maven Central:
112112
Maven:
113113
```xml
114114
<dependency>
115-
<groupId>com.github.jknack</groupId>
115+
<groupId>com.iterable</groupId>
116116
<artifactId>handlebars-proto</artifactId>
117117
<version>${current-version}</version>
118118
</dependency>
@@ -274,7 +274,7 @@ context: A template name. Required.
274274

275275
wrapper: One of "anonymous", "amd" or "none". Default is: "anonymous"
276276

277-
There is a [maven plugin](https://github.com/jknack/handlebars.java/tree/master/handlebars-maven-plugin) available too.
277+
There is a [maven plugin](https://github.com/iterable/handlebars.java/tree/master/handlebars-maven-plugin) available too.
278278

279279
### embedded
280280
The embedded helper allow you to "embedded" a handlebars template inside a ```<script>``` HTML tag:
@@ -378,12 +378,12 @@ The generated code looks like this:
378378
Finally, it converts message patterns like: ```Hi {0}``` into ```Hi {{arg0}}```. This make possible for the [I18n](https://github.com/fnando/i18n-js) JS library to interpolate variables.
379379

380380
### string helpers
381-
Functions like abbreviate, capitalize, join, dateFormat, yesno, etc., are available from [StringHelpers](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/StringHelpers.java).
381+
Functions like abbreviate, capitalize, join, dateFormat, yesno, etc., are available from [StringHelpers](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/StringHelpers.java).
382382

383383
> NOTE: You need to register string helpers (they are not added by default)
384384
385385
### conditional helpers
386-
Functions like eq, neq, lt, gt, and, or, not, etc., are available from [ConditionalHelpers](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/ConditionalHelpers.java).
386+
Functions like eq, neq, lt, gt, and, or, not, etc., are available from [ConditionalHelpers](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/ConditionalHelpers.java).
387387

388388
> NOTE: You need to register conditional helpers (they are not added by default)
389389
@@ -711,7 +711,7 @@ Context context = Context
711711
.build();
712712
```
713713

714-
Available in [Jackson 1.x](https://github.com/jknack/handlebars.java/tree/master/handlebars-json) and [Jackson 2.x](https://github.com/jknack/handlebars.java/tree/master/handlebars-jackson2) modules.
714+
Available in [Jackson 1.x](https://github.com/iterable/handlebars.java/tree/master/handlebars-json) and [Jackson 2.x](https://github.com/iterable/handlebars.java/tree/master/handlebars-jackson2) modules.
715715

716716
#### Using multiples value resolvers
717717

@@ -776,7 +776,7 @@ This cache implementation eliminates the window created by ```ConcurrentMapTempl
776776
It follows the patterns described in [Java Concurrency in Practice](http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601) and ensures that a template will be compiled just once regardless of the number of threads.
777777

778778

779-
3. ```GuavaTemplateCache```: a template cache implementation built on top of [Google Guava](https://code.google.com/p/guava-libraries/wiki/CachesExplained). Available in [handlebars-guava-cache module](https://github.com/jknack/handlebars.java/tree/master/handlebars-guava-cache)
779+
3. ```GuavaTemplateCache```: a template cache implementation built on top of [Google Guava](https://code.google.com/p/guava-libraries/wiki/CachesExplained). Available in [handlebars-guava-cache module](https://github.com/iterable/handlebars.java/tree/master/handlebars-guava-cache)
780780

781781
You can configure Handlebars.java to use a cache by:
782782

@@ -786,7 +786,7 @@ Handlebars hbs = new Handlebars()
786786
```
787787

788788
### Using a MissingValueResolver (@deprecated)
789-
NOTE: MissingValueResolver is available in ```<= 1.3.0```. For ```> 1.3.0``` use [Helper Missing](https://github.com/jknack/handlebars.java#helper-missing).
789+
NOTE: MissingValueResolver is available in ```<= 1.3.0```. For ```> 1.3.0``` use [Helper Missing](https://github.com/iterable/handlebars.java#helper-missing).
790790

791791
A ```MissingValueResolver``` let you use default values for ```{{variable}}``` expressions resolved to ```null```.
792792

@@ -853,7 +853,7 @@ Hello edgar!
853853
Maven:
854854
```xml
855855
<dependency>
856-
<groupId>com.github.jknack</groupId>
856+
<groupId>com.iterable</groupId>
857857
<artifactId>handlebars-json</artifactId>
858858
<version>${handlebars-version}</version>
859859
</dependency>
@@ -890,7 +890,7 @@ pretty: True, if the JSON content must be formatted. Default is: false.
890890
Maven:
891891
```xml
892892
<dependency>
893-
<groupId>com.github.jknack</groupId>
893+
<groupId>com.iterable</groupId>
894894
<artifactId>handlebars-jackson2</artifactId>
895895
<version>${handlebars-version}</version>
896896
</dependency>
@@ -903,7 +903,7 @@ Same as Jackson1.x, except for the name of the helper: ```Jackson2Helper```
903903
Maven:
904904
```xml
905905
<dependency>
906-
<groupId>com.github.jknack</groupId>
906+
<groupId>com.iterable</groupId>
907907
<artifactId>handlebars-markdown</artifactId>
908908
<version>${handlebars-version}</version>
909909
</dependency>
@@ -923,7 +923,7 @@ context: An object or null. Required.
923923
Maven:
924924
```xml
925925
<dependency>
926-
<groupId>com.github.jknack</groupId>
926+
<groupId>com.iterable</groupId>
927927
<artifactId>handlebars-humanize</artifactId>
928928
<version>${handlebars-version}</version>
929929
</dependency>
@@ -935,14 +935,14 @@ Usage:
935935
HumanizeHelper.register(handlebars);
936936
```
937937

938-
See the JavaDoc of the [HumanizeHelper] (https://github.com/jknack/handlebars.java/blob/master/handlebars-humanize/src/main/java/com/github/jknack/handlebars/HumanizeHelper.java) for more information.
938+
See the JavaDoc of the [HumanizeHelper] (https://github.com/iterable/handlebars.java/blob/master/handlebars-humanize/src/main/java/com/github/jknack/handlebars/HumanizeHelper.java) for more information.
939939

940940
## SpringMVC
941941

942942
Maven:
943943
```xml
944944
<dependency>
945-
<groupId>com.github.jknack</groupId>
945+
<groupId>com.iterable</groupId>
946946
<artifactId>handlebars-springmvc</artifactId>
947947
<version>${handlebars-version}</version>
948948
</dependency>
@@ -967,7 +967,7 @@ where:
967967
* arg: the message's argument. Optional.
968968
* default: the default's message. Optional.
969969
970-
Checkout the [HandlebarsViewResolver](https://github.com/jknack/handlebars.java/blob/master/handlebars-springmvc/src/main/java/com/github/jknack/handlebars/springmvc/HandlebarsViewResolver.java).
970+
Checkout the [HandlebarsViewResolver](https://github.com/iterable/handlebars.java/blob/master/handlebars-springmvc/src/main/java/com/github/jknack/handlebars/springmvc/HandlebarsViewResolver.java).
971971
972972
# Performance
973973
@@ -1027,11 +1027,11 @@ Hello {{#child}}{{this.value}}{{/child}}
10271027
## Status
10281028
### Mustache 1.0 Compliant
10291029
* Passes the 123 tests from the [Mustache Spec](https://github.com/mustache/spec).
1030-
* Tests can be found here [comments.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/CommentsTest.java), [delimiters.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/DelimitersTest.java), [interpolation.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/InterpolationTest.java), [inverted.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/InvertedTest.java), [lambdas.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/LambdasTest.java), [partials.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/PartialsTest.java), [sections.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/SectionsTest.java)
1030+
* Tests can be found here [comments.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/CommentsTest.java), [delimiters.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/DelimitersTest.java), [interpolation.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/InterpolationTest.java), [inverted.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/InvertedTest.java), [lambdas.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/LambdasTest.java), [partials.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/PartialsTest.java), [sections.yml](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/specs/SectionsTest.java)
10311031

10321032
### Handlebars.js Compliant
10331033
* Passes all the [Handlebars.js tests](https://github.com/wycats/handlebars.js/blob/master/spec/qunit_spec.js)
1034-
* Tests can be found here [basic context](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BasicContextTest.java), [string literals](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/StringLiteralParametersTest.java), [inverted sections](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/InvertedSectionTest.java), [blocks](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BlockTest.java), [block helper missing](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BlockHelperMissingTest.java), [helper hash](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/HelperHashTest.java), [partials](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/PartialsTest.java)
1034+
* Tests can be found here [basic context](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BasicContextTest.java), [string literals](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/StringLiteralParametersTest.java), [inverted sections](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/InvertedSectionTest.java), [blocks](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BlockTest.java), [block helper missing](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BlockHelperMissingTest.java), [helper hash](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/HelperHashTest.java), [partials](https://github.com/iterable/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/PartialsTest.java)
10351035

10361036
## Dependencies
10371037

@@ -1044,8 +1044,8 @@ Hello {{#child}}{{this.value}}{{/child}}
10441044
## Want to contribute?
10451045
* Fork the project on Github.
10461046
* Wondering what to work on? See task/bug list and pick up something you would like to work on.
1047-
* Do you want to donate one or more helpers? See [handlebars=helpers](https://github.com/jknack/handlebars.java/tree/master/handlebars-helpers) a repository for community's helpers.
1048-
* Create an issue or fix one from [issues list](https://github.com/jknack/handlebars.java/issues).
1047+
* Do you want to donate one or more helpers? See [handlebars=helpers](https://github.com/iterable/handlebars.java/tree/master/handlebars-helpers) a repository for community's helpers.
1048+
* Create an issue or fix one from [issues list](https://github.com/iterable/handlebars.java/issues).
10491049
* If you know the answer to a question posted to our [mailing list](https://groups.google.com/forum/#!forum/handlebarsjava) - don't hesitate to write a reply.
10501050
* Share your ideas or ask questions on [mailing list](https://groups.google.com/forum/#!forum/handlebarsjava) - don't hesitate to write a reply - that helps us improve javadocs/FAQ.
10511051
* If you miss a particular feature - browse or ask on the [mailing list](https://groups.google.com/forum/#!forum/handlebarsjava) - don't hesitate to write a reply, show us some sample code and describe the problem.
@@ -1056,7 +1056,7 @@ Hello {{#child}}{{this.value}}{{/child}}
10561056
## Help and Support
10571057
[Help and discussion](https://groups.google.com/forum/#!forum/handlebarsjava)
10581058

1059-
[Bugs, Issues and Features](https://github.com/jknack/handlebars.java/issues)
1059+
[Bugs, Issues and Features](https://github.com/iterable/handlebars.java/issues)
10601060

10611061

10621062
## Related Projects

0 commit comments

Comments
 (0)