update readme #117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish package to the Maven Central Repository | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
cacheKey: ${{ steps.cacheKey.outputs.cacheKey }} | |
steps: | |
- run: echo "CACHE_KEY=maven-de-tschuehly-$(date +%s)" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: make gradle executable | |
run: chmod +x ./gradlew | |
- name: publishToMavenLocal | |
run: ./gradlew :core:publishToMavenLocal :thymeleaf:publishToMavenLocal :jte:publishToMavenLocal :jte-compiler:publishToMavenLocal | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ env.CACHE_KEY }} | |
- id: cacheKey | |
run: echo "cacheKey=${{ env.CACHE_KEY }}" >> $GITHUB_OUTPUT | |
test-thymeleaf-kotlin: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ needs.build.outputs.cacheKey }} | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: run thymeleaf kotlin tests | |
run: | | |
cd ./examples/thymeleaf-kotlin-example | |
chmod +x ./gradlew | |
./gradlew test | |
test-thymeleaf-java: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ needs.build.outputs.cacheKey }} | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: run thymeleaf java tests | |
run: | | |
cd ./examples/thymeleaf-java-example | |
chmod +x ./mvnw | |
./mvnw test | |
test-jte: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ needs.build.outputs.cacheKey }} | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: run jte java tests | |
run: | | |
cd ./examples/jte-example | |
chmod +x ./gradlew | |
./gradlew test | |
chmod +x ./mvnw | |
./mvnw test | |
test-kte: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ needs.build.outputs.cacheKey }} | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: run kte kotlin tests | |
run: | | |
cd ./examples/kte-example | |
chmod +x ./gradlew | |
./gradlew test | |
publish: | |
needs: [test-jte,test-kte, test-thymeleaf-kotlin,test-thymeleaf-java] | |
if: github.ref_type == 'tag' || contains(github.ref_name, 'SNAPSHOT') | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ needs.build.outputs.cacheKey }} | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Run chmod to make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Publish thymeleaf package to staging | |
run: ./gradlew :thymeleaf:publish | |
- name: Publish thymeleaf package to maven central | |
env: | |
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | |
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew :thymeleaf:jreleaserDeploy -DaltDeploymentRepository=local::file:./thymeleaf/build/staging-deploy --stacktrace | |
- name: Publish jte package to staging | |
run: ./gradlew :jte:publish | |
- name: Publish jte package to maven central | |
env: | |
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | |
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew :jte:jreleaserDeploy -DaltDeploymentRepository=local::file:./jte/jte/build/staging-deploy --stacktrace | |
- name: Publish jte-compiler package to staging | |
run: ./gradlew :jte-compiler:publish | |
- name: Publish jte package to maven central | |
env: | |
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | |
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew :jte-compiler:jreleaserDeploy -DaltDeploymentRepository=local::file:./jte/jte-compiler/build/staging-deploy --stacktrace | |
- name: Publish core package to staging | |
run: ./gradlew :core:publish | |
- name: Publish core package to maven central | |
env: | |
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | |
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew :core:jreleaserDeploy -DaltDeploymentRepository=local::file:./core/build/staging-deploy --stacktrace |