Skip to content

Commit f586f15

Browse files
committed
add manual build for github actions
1 parent 5bd6c16 commit f586f15

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

.github/workflows/manual.yml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,28 @@ name: manualbuild
33
on:
44
workflow_dispatch:
55
inputs:
6-
api_base_url:
7-
description: URL of the REST API
6+
app_version:
7+
description: Version of application
88
required: true
9-
default: https://test-csuapps.minsante.cm/rest/
9+
default: 1.0.0
10+
release_tag:
11+
description: Tag to publish update
12+
required: true
13+
default: csu-test
14+
1015
# Branch is chosen by default in github manual actions
1116

1217
jobs:
1318
build:
1419
runs-on: ubuntu-latest
1520

1621
steps:
17-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
1823

1924
- name: Setup JDK 17
20-
uses: actions/setup-java@v2
25+
uses: actions/setup-java@v5
2126
with:
22-
distribution: 'temurin'
27+
distribution: 'zulu'
2328
java-version: '17'
2429
cache: 'gradle'
2530

@@ -32,24 +37,33 @@ jobs:
3237
run: |
3338
chmod +x gradlew
3439
35-
- name: show gradlew permission
36-
run: |
37-
chmod +x gradlew
38-
3940
- name: build
4041
run: |
41-
./gradlew assemblecsuDevDebug --stacktrace
42+
./gradlew assembleCsuDevDebug --stacktrace
4243
env:
43-
API_BASE_URL: "${{ github.event.inputs.api_base_url }}"
44+
APP_VERSION: "${{ github.event.inputs.app_version }}"
4445

45-
- name: Environment info
46-
run: |
47-
gradle --version
46+
# Run Tests Build
47+
- name: Run gradle tests
48+
run: ./gradlew testCsuDevDebugUnitTest --stacktrace
4849

4950
- uses: actions/upload-artifact@v4
5051
with:
51-
name: claims-csu-${{github.run_number}}.apk
52-
path: ./claimManagement/build/outputs/**/*.apk
52+
name: claims-csuTest-${{github.event.inputs.app_version}}.apk
53+
path: ./app/build/outputs/**/*.apk
54+
overwrite: true
55+
56+
#publish in release
57+
- name: Edit release ${{ github.event.inputs.app_version }}
58+
uses: softprops/action-gh-release@v1
59+
with:
60+
tag_name: ${{ github.event.inputs.release_tag }} # Sets the release tag to the pushed tag name (e.g., v1.0.0)
61+
name: ${{ github.event.inputs.app_version }} # Sets the release name to the pushed tag name (e.g., Release v1.0.0)
62+
files: ./app/build/outputs/**/*.apk
63+
draft: false
64+
prerelease: false
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5367

5468
# - name: build
5569
# run: |

claimManagement/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727
minSdkVersion 26
2828
targetSdkVersion 33
2929
versionCode 4
30-
versionName "2.3.7"
30+
versionName System.getenv("APP_VERSION") ?: "2.3.7"
3131
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
3232
}
3333
buildTypes {

0 commit comments

Comments
 (0)