-
Notifications
You must be signed in to change notification settings - Fork 5
77 lines (63 loc) · 2.31 KB
/
continuous-deployment.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
69
70
71
72
73
74
75
76
77
name: Continuous deployment
env:
main_project_module: android
on:
push:
branches:
- develop # Automatically generates snapshot versions
- release/* # Automatically generates release versions
workflow_dispatch: ## manually generates release versions
inputs:
release_version:
description: 'Please, enter the release version'
required: true
type: string
jobs:
publish-maven:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Publish to maven
run: ./.github/workflows/scripts/publish-maven.sh
env:
OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
SIGNING_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
SIGNING_PASSWORD: ${{ secrets.PGP_PASSPHRASE }}
publish_github:
runs-on: ubuntu-latest
if: ${{ (inputs.release_version) && (inputs.release_version != '') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Build Android (APK) - ${{ env.main_project_module }} module
run: ./gradlew assembleDebug
- name: Rename APK
run: |
mv ${{ env.main_project_module }}/build/outputs/apk/debug/android-debug.apk ${{ env.main_project_module }}/build/outputs/apk/debug/ui-components-android-${{ inputs.release_version }}.apk
- name: Github Release
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
draft: true
generateReleaseNotes: true
name: "Release notes - DHIS2 Design system: ${{ inputs.release_version }}"
tag: ${{ inputs.release_version }}
artifacts: ${{ env.main_project_module }}/build/outputs/apk/debug/ui-components-android-${{ inputs.release_version }}.apk