-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.36 KB
/
Copy pathcd.yml
File metadata and controls
51 lines (41 loc) · 1.36 KB
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
name: cd
on:
release:
branches: [main]
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Pull library version from build.gradle
run: |
echo "lib_v=$(grep "version" jcmake/build.gradle | awk '{print $2}' | tr -d \''"\')" >> $GITHUB_ENV
- name: Checking if library version from build.gradle and release tag matches
run: |
if [ "${{ github.ref_name }}" = "${{ env.lib_v }}" ]; then
echo "Release tag and library version matches"
else
echo "Release tag should match the build version for the package"
exit 1
fi
- name: setup project configuration
run: bash .github/workflows/setup.sh ${{ secrets.gh_username }} ${{ secrets.access_token }}
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Run Unit Tests
run: ./gradlew :jcmake:testDebugUnitTest
- name: Build release
run: ./gradlew assembleRelease
- name: Upload build archive
uses: actions/[email protected]
with:
name: lib
path: jcmake/build/outputs/aar/jcmake-release.aar
- name: Publish artifact
run: |
./gradlew publish