Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit d67c6ee

Browse files
authored
Improvements to Action workflows (#21)
* Use release-drafter action to track changes * Auto-deploy docs website on release * Tweak caching in build workflow
1 parent 754ece6 commit d67c6ee

File tree

5 files changed

+81
-8
lines changed

5 files changed

+81
-8
lines changed

.github/release-drafter.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
template: |
4+
## What’s Changed
5+
$CHANGES

.github/workflows/build.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ jobs:
3232
- name: Generate cache key
3333
run: ./checksum.sh checksum.txt
3434

35-
- uses: actions/cache@v1
35+
- uses: actions/cache@v2
3636
with:
37-
path: ~/.gradle/caches
37+
path: |
38+
~/.gradle/caches/modules-*
39+
~/.gradle/caches/jars-*
40+
~/.gradle/caches/build-cache-*
3841
key: gradle-${{ hashFiles('checksum.txt') }}
3942

4043
- name: Build, lint and spotless
@@ -62,9 +65,12 @@ jobs:
6265
- name: Generate cache key
6366
run: ./checksum.sh checksum.txt
6467

65-
- uses: actions/cache@v1
68+
- uses: actions/cache@v2
6669
with:
67-
path: ~/.gradle/caches
70+
path: |
71+
~/.gradle/caches/modules-*
72+
~/.gradle/caches/jars-*
73+
~/.gradle/caches/build-cache-*
6874
key: gradle-${{ hashFiles('checksum.txt') }}
6975

7076
- name: Run tests
@@ -105,9 +111,12 @@ jobs:
105111
- name: Generate cache key
106112
run: ./checksum.sh checksum.txt
107113

108-
- uses: actions/cache@v1
114+
- uses: actions/cache@v2
109115
with:
110-
path: ~/.gradle/caches
116+
path: |
117+
~/.gradle/caches/modules-*
118+
~/.gradle/caches/jars-*
119+
~/.gradle/caches/build-cache-*
111120
key: gradle-${{ hashFiles('checksum.txt') }}
112121

113122
- name: Deploy to GitHub packages

.github/workflows/deploy_docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish docs
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
deploy_docs:
10+
runs-on: ubuntu-latest
11+
env:
12+
JAVA_TOOL_OPTIONS: -Xmx5120m
13+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.compiler.execution.strategy=in-process
14+
TERM: dumb
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Setup JDK 8 (1.8)
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 8
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Install dependencies
30+
run: |
31+
python3 -m pip install --upgrade pip
32+
python3 -m pip install mkdocs
33+
python3 -m pip install mkdocs-material
34+
35+
- name: Generate docs
36+
run: ./generate_docs.sh
37+
38+
- name: Build site
39+
run: mkdocs build
40+
41+
- name: Deploy
42+
uses: peaceiris/actions-gh-pages@v3
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: ./site

.github/workflows/update-release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Update release
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
update_draft_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy_docs.sh renamed to generate_docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ cp CONTRIBUTING.md docs/contributing.md
66
sed -i 's/CONTRIBUTING.md/\/contributing/' docs/index.md
77
sed -i 's/docs\/using-snapshot-version.md/using-snapshot-version/' docs/index.md
88

9-
# Deploy to Github pages.
10-
mkdocs gh-deploy
9+
# Build the docs
10+
./gradlew clean dokka

0 commit comments

Comments
 (0)