@@ -3,42 +3,18 @@ name: Build pull request
33on :
44 workflow_dispatch :
55 inputs :
6- # Select pull request
76 pr-number :
8- description : PR number (Without hashtag)
7+ description : PR number
98 required : true
10- # Select app flavor
119 app-flavor :
1210 description : App flavor
13- default : ' release'
11+ default : release
1412 type : choice
1513 options :
1614 - release
1715 - debug
1816 - profile
1917
20- # Flutter Configurations,
21- # it's recommended to be set when you have problem regarding with flutter itself
22- # For most part you do not need to change this.
23-
24- # Flutter version to use, note that the version had to exist in whether channel
25- # to grab
26- # Try using exact version or particular version on a specific branch instead of "any"
27- flutter-channel :
28- description : Flutter channel
29- default : ' stable'
30- type : choice
31- options :
32- - stable
33- - beta
34- - dev
35- - any
36- flutter-version :
37- description : Flutter version
38- default : ' 3.29.x'
39-
40- run-name : " Build pull request ${{ inputs.pr-number }}"
41-
4218jobs :
4319 build :
4420 name : Build
@@ -62,76 +38,34 @@ jobs:
6238 - name : Set up Flutter
6339 uses : subosito/flutter-action@v2
6440 with :
65- channel : ${{ inputs.flutter-channel }}
66- flutter-version : ${{ inputs.flutter-version }}
67-
41+ channel : stable
42+ flutter-version : 3.29.x
43+ cache : true
44+
45+ - name : Cache Gradle
46+ uses : burrunan/gradle-cache-action@v3
47+ with :
48+ build-root-directory : ${{ github.workspace }}/android
49+
6850 - name : Get dependencies
69- continue-on-error : true
7051 run : flutter pub get
7152
7253 - name : Generate translations
73- continue-on-error : true
7454 run : dart run slang
7555
7656 - name : Generate code files
77- continue-on-error : true
7857 run : dart run build_runner build --delete-conflicting-outputs
7958
8059 - name : Build
81- continue-on-error : true
8260 id : flutter-build
8361 run : flutter build apk --${{ inputs.app-flavor }}
8462 env :
8563 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8664
87- - name : Prepare comment
88- id : prepare-comment # This should work now?
89- run : |
90- echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
91- if [[ "${{ steps.flutter-build.outcome }}" == "success" ]]; then
92- MESSAGE="✅ Succeeded build on $COMMIT_HASH."
93- else
94- MESSAGE="🚫 Failed build on $COMMIT_HASH."
95- fi
96-
97- - name : " Comment on pull request #${{ inputs.pr-number }}"
98- uses : thollander/actions-comment-pull-request@v3
99- with :
100- github-token : ${{ github.token }}
101- pr-number : ${{ inputs.pr-number }}
102- mode : recreate
103- comment-tag : execution
104- message : |
105- ## ⚒️ Build status
106-
107- 🧪 Workflow triggered by: ${{ github.actor }}
108-
109- ${{ steps.prepare-comment.outputs.MESSAGE }}
110-
111- Details: [_Job execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**_](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!
112-
113- ### ⚙️ Workflow Steps
114-
115- | Step | Status |
116- | :------------------------ | :------------------------------------------------------- |
117- | **Get dependencies** | ${{ steps.get-dependencies.outcome || job.status }} |
118- | **Generate translations** | ${{ steps.generate-translations.outcome || job.status }} |
119- | **Generate code files** | ${{ steps.generate-code-files.outcome || job.status }} |
120- | **Build** | ${{ steps.flutter-build.outcome }} |
121-
122- ### ⚙️ Workflow Configuration
123-
124- | Parameter | Value |
125- | :--------------- | :--------------------------------------- |
126- | App flavor | ${{ inputs.app-flavor }} |
127- | Flutter version | ${{ inputs.flutter-version }} |
128- | Flutter channel | ${{ inputs.flutter-channel }} |
129-
130- - name : Upload Artifact
65+ - name : Upload artifacts
13166 if : steps.flutter-build.outcome == 'success'
13267 uses : actions/upload-artifact@v4
13368 with :
134- name : revanced-manager-(${{ env.COMMIT_HASH }}-${{ inputs.pr-number }}-${{ inputs.app-flavor }}-${{ inputs.flutter-version }})
69+ name : revanced-manager-(${{ env.COMMIT_HASH }}
13570 path : |
136- build/app/outputs/flutter-apk/app-${{ inputs.app-flavor }}.apk
137- build/app/outputs/flutter-apk/app-${{ inputs.app-flavor }}.apk.sha1
71+ build/app/outputs/flutter-apk/app-*.apk
0 commit comments