-
Notifications
You must be signed in to change notification settings - Fork 29
61 lines (50 loc) · 1.56 KB
/
publish.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
50
51
52
53
54
55
56
57
58
59
60
61
name: Publish a new version for the library
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/[email protected]
with:
java-version: 17
distribution: temurin
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build the library
run: ./gradlew lib:build
- name: Update README.md version
run: ./gradlew lib:updateReadmeVersion
- name: Check if the README.md version was updated correctly
shell: bash
run: |
FILE="README.md"
PATTERN="implementation 'com\.github\.LeandroSQ:android-ble-made-easy:([0-9]+\.[0-9]+\.[0-9]+)'"
if [[ $(cat $FILE) =~ $PATTERN ]]; then
VERSION="${BASH_REMATCH[1]}"
echo $VERSION
else
echo "Error: Could not find version number in $FILE." >&2
exit 1
fi
- name: Publish to Jitpack
run: ./gradlew lib:publish
- name: Generate Documentation with Dokka
run: |
./gradlew lib:dokkaHtml
echo "Deleting old documentation files"
rm -rf ./docs
echo "Moving generated documentation files"
mv -f lib/build/dokka/html ./docs
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs