Skip to content

Commit d47388b

Browse files
committed
fix github actions
1 parent e86c5c4 commit d47388b

3 files changed

Lines changed: 53 additions & 45 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616

1717
- name: Setup JDK 17
18-
uses: actions/setup-java@v2
18+
uses: actions/setup-java@v5
1919
with:
2020
distribution: 'temurin'
2121
java-version: '17'
@@ -29,29 +29,24 @@ jobs:
2929
run: |
3030
chmod +x gradlew
3131
32-
- name: build
33-
run: |
34-
./gradlew assemblecsuDevDebug --stacktrace
35-
36-
- name: Environment info
37-
run: |
38-
gradle --version
39-
40-
- uses: actions/upload-artifact@v4
41-
with:
42-
name: claims-csu-${{github.run_number}}.apk
43-
path: ./claimManagement/build/outputs/**/*.apk
44-
45-
- name: build
46-
run: |
47-
./gradlew bundlecsuDevDebug --stacktrace
48-
49-
- name: Environment info
50-
run: |
51-
gradle --version
52-
53-
- uses: actions/upload-artifact@v4
54-
with:
55-
name: claims-csu-${{github.run_number}}.aab
56-
path: ./claimManagement/build/outputs/**/*.aab
32+
- name: run gradle tests
33+
run: ./gradlew testCsuDevDebugUnitTest --stacktrace
34+
35+
# - name: build
36+
# run: |
37+
# ./gradlew assembleCsuDevDebug --stacktrace
38+
39+
# - uses: actions/upload-artifact@v4
40+
# with:
41+
# name: claims-csu-${{github.run_number}}.apk
42+
# path: ./claimManagement/build/outputs/**/*.apk
43+
44+
# - name: build
45+
# run: |
46+
# ./gradlew bundlecsuDevDebug --stacktrace
47+
#
48+
# - uses: actions/upload-artifact@v4
49+
# with:
50+
# name: claims-csu-${{github.run_number}}.aab
51+
# path: ./claimManagement/build/outputs/**/*.aab
5752

.github/workflows/manual.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,66 @@ 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
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

2631
- name: Environment info
2732
run: |
2833
gradle --version
29-
echo url ${{ github.event.inputs.api_base_url }}
30-
31-
- name: show gradlew permission
32-
run: |
33-
chmod +x gradlew
3434
3535
- name: show gradlew permission
3636
run: |
3737
chmod +x gradlew
3838
3939
- name: build
4040
run: |
41-
./gradlew assemblecsuDevDebug --stacktrace
41+
./gradlew assembleCsuDevDebug --stacktrace
4242
env:
43-
API_BASE_URL: "${{ github.event.inputs.api_base_url }}"
43+
APP_VERSION: "${{ github.event.inputs.app_version }}"
4444

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

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

5467
# - name: build
5568
# 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)