Skip to content

Commit 92f5227

Browse files
committed
Add tag job on push to master
Add tag to repo after successful tests.
1 parent 5f550ee commit 92f5227

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/publish.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Cache gradle dependencies
15+
uses: actions/cache@v1
16+
with:
17+
path: ~/.gradle
18+
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties') }}
19+
restore-keys: |
20+
${{ runner.os }}-gradle-
21+
${{ runner.os }}-
22+
- name: set up JDK 1.8
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 1.8
26+
27+
- name: Run tests with Gradle
28+
run: ./gradlew testDebug --no-daemon
29+
- name: Archive test results
30+
uses: actions/upload-artifact@v1
31+
if: always()
32+
with:
33+
name: test-results
34+
path: "yoti-sdk/build/reports/tests/"
35+
36+
- name: Build sample-1
37+
run: ./gradlew sample-app:assembleDebug --no-daemon
38+
- name: Upload sample-1
39+
uses: actions/upload-artifact@v1
40+
with:
41+
name: sample-1
42+
path: "sample-app/build/outputs/apk/"
43+
44+
- name: Build sample-2
45+
run: ./gradlew sample-app-2:assembleDebug --no-daemon
46+
- name: Upload sample-2
47+
uses: actions/upload-artifact@v1
48+
with:
49+
name: sample-2
50+
path: "sample-app-2/build/outputs/apk/"
51+
52+
tag:
53+
runs-on: ubuntu-latest
54+
needs: check
55+
56+
steps:
57+
- uses: actions/checkout@v1
58+
- name: Add tag
59+
run: |
60+
CURRENT_VERSION=`cat gradle.properties | grep "pomVersion\s*=" | sed "s/pomVersion\s*=//"`
61+
git config --local user.email "[email protected]"
62+
git config --local user.name "GitHub Action"
63+
git tag -a v$CURRENT_VERSION -m "Version $CURRENT_VERSION deployed by Github Actions"
64+
- name: Push tag
65+
uses: ad-m/github-push-action@master
66+
with:
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
tags: true

0 commit comments

Comments
 (0)