-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (46 loc) · 1.92 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build and tests on every commit
# This workflow is triggered on pushes to the repository.
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Cache gradle
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: build
run: ./gradlew ktlintCheck build -Pversion="${{github.ref_name}}"
- name: Release "${{github.ref_name}}"
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
tiny-cli/build/distributions/tiny-cli-${{github.ref_name}}.zip
tiny-cli/build/distributions/tiny-cli-${{github.ref_name}}.tar
- name: Update documentation sample
run: |
unzip tiny-cli/build/distributions/tiny-cli-${{github.ref_name}}.zip
tiny-cli-${{github.ref_name}}/bin/tiny-cli export tiny-sample
unzip -o -d tiny-doc/src/docs/asciidoc/sample tiny-sample/tiny-export.zip
- name: Build examples and generate Asciidoctor HTML pages
run: ./gradlew asciidoctor -Pversion="${{github.ref_name}}"
- name: Copy generated content into gh-pages.
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tiny-doc/build/docs/asciidoc
env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"