forked from patrykandpatrick/vico
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (60 loc) · 2.34 KB
/
neutral-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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Neutral Build
on:
push:
branches:
- 'tangem-master'
workflow_dispatch:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DVELOPMENT_ANDROID }}
jobs:
tag:
name: Create tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: vico
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
- uses: gradle/gradle-build-action@v3
- name: Build
run: |
cd ${{ github.workspace }}/vico
VERSION_NAME=$(grep -oP "(?<=version_name).*(?=\",)" versions.gradle | grep -oP "(?<=\").*")
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
./gradlew assembleDebug
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ env.VERSION_NAME }}-tangem${{ github.run_number }}",
sha: context.sha
})
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: |
cd ${{ github.workspace }}/vico
echo sdk.dir = $ANDROID_HOME > local.properties
./gradlew -PgithubUser=${{ secrets.GITHUB_ACTOR }} -PgithubPass=${{ secrets.GITHUB_TOKEN }} -PpublishVersion=${{ env.VERSION_NAME }}-tangem${{ github.run_number }} publish
- name: Build notification
if: always()
uses: adamkdean/simple-slack-notify@master
with:
channel: '#development-android'
status: ${{ job.status }}
success_text: 'Tangem Vico library build (${{ env.VERSION_NAME }}-tangem${{ github.run_number }}) has been created and uploaded to Nexus.'
failure_text: 'GitHub Action #${{ github.run_number }} failed. Tag has not been not created.'
cancelled_text: 'GitHub Action #${{ github.run_number }} was cancelled'
fields: |
[{"title": "TAG", "value": "${{ env.VERSION_NAME }}-tangem${{ github.run_number }}"},
{"title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}]