@@ -78,78 +78,78 @@ jobs:
7878 run : |
7979 rm -f ~/.gradle/caches/modules-2/modules-2.lock
8080 rm -f ~/.gradle/caches/modules-2/gc.properties
81-
82- apk :
83- name : Generate and Deploy APK
84- runs-on : ubuntu-latest
85- needs :
86- - test
87- steps :
88- - name : Checkout Code
89- uses : actions/checkout@v2
90-
91- - name : Set up JDK 11
92- uses : actions/setup-java@v1
93- with :
94- java-version : 11
95-
96- - name : Build APK
97- run : ./gradlew assembleDebug --stacktrace
98-
99- - name : Generate Hash of New APK
100- id : hash_new_apk
101- run : |
102- apk_hash=$(sha256sum app/sample.apk | awk '{print $1}')
103- echo "::set-output name=hash::$apk_hash"
104-
105- - name : Download Hash of Previous APK
106- id : download_hash
107- uses : actions/download-artifact@v2
108- with :
109- name : previous_apk_hash
110- path : previous_apk_hash.txt
111- if : always()
112-
113- - name : Compare Hashes
114- id : compare_hashes
115- run : |
116- if [ ! -f "previous_apk_hash.txt" ]; then
117- echo "No previous APK hash found. Continuing..."
118- elif [ "$(cat previous_apk_hash.txt)" = "${{ steps.hash_new_apk.outputs.hash }}" ]; then
119- echo "APK has not changed. Exiting."
120- exit 0
121- fi
122- echo "${{ steps.hash_new_apk.outputs.hash }}" > previous_apk_hash.txt
123-
124- - name : Rename and Move APK
125- run : |
126- mv app/build/outputs/apk/debug/app-debug.apk app/sample.apk
127-
128- - name : Upload APK
129- uses : actions/upload-artifact@v2
130- with :
131- name : sample.apk
132- path : app/sample.apk
133-
134- - name : Create Pull Request
135- uses : peter-evans/create-pull-request@v3
136- with :
137- token : ${{ secrets.GITHUB_TOKEN }}
138- commit-message : " (General) Update sample APK"
139- title : " (General) Update sample APK"
140- branch : " apk-update"
141- body : |
142- This pull request updates the sample APK.
143-
144- ```
145- Version code: ${{ steps.version.outputs.version_code }}
146- Version name: ${{ steps.version.outputs.version_name }}
147- ```
148-
149- - name : Clean up artifacts
150- if : ${{ always() }}
151- run : |
152- rm -f previous_apk_hash.txt
153- echo "Deleted previous_apk_hash.txt"
154- echo "Deleting sample APK..."
155- curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/sample.apk"
81+ #
82+ # apk:
83+ # name: Generate and Deploy APK
84+ # runs-on: ubuntu-latest
85+ # needs:
86+ # - test
87+ # steps:
88+ # - name: Checkout Code
89+ # uses: actions/checkout@v2
90+ #
91+ # - name: Set up JDK 11
92+ # uses: actions/setup-java@v1
93+ # with:
94+ # java-version: 11
95+ #
96+ # - name: Build APK
97+ # run: ./gradlew assembleDebug --stacktrace
98+ #
99+ # - name: Generate Hash of New APK
100+ # id: hash_new_apk
101+ # run: |
102+ # apk_hash=$(sha256sum app/sample.apk | awk '{print $1}')
103+ # echo "::set-output name=hash::$apk_hash"
104+ #
105+ # - name: Download Hash of Previous APK
106+ # id: download_hash
107+ # uses: actions/download-artifact@v2
108+ # with:
109+ # name: previous_apk_hash
110+ # path: previous_apk_hash.txt
111+ # if: always()
112+ #
113+ # - name: Compare Hashes
114+ # id: compare_hashes
115+ # run: |
116+ # if [ ! -f "previous_apk_hash.txt" ]; then
117+ # echo "No previous APK hash found. Continuing..."
118+ # elif [ "$(cat previous_apk_hash.txt)" = "${{ steps.hash_new_apk.outputs.hash }}" ]; then
119+ # echo "APK has not changed. Exiting."
120+ # exit 0
121+ # fi
122+ # echo "${{ steps.hash_new_apk.outputs.hash }}" > previous_apk_hash.txt
123+ #
124+ # - name: Rename and Move APK
125+ # run: |
126+ # mv app/build/outputs/apk/debug/app-debug.apk app/sample.apk
127+ #
128+ # - name: Upload APK
129+ # uses: actions/upload-artifact@v2
130+ # with:
131+ # name: sample.apk
132+ # path: app/sample.apk
133+ #
134+ # - name: Create Pull Request
135+ # uses: peter-evans/create-pull-request@v3
136+ # with:
137+ # token: ${{ secrets.GITHUB_TOKEN }}
138+ # commit-message: "(General) Update sample APK"
139+ # title: "(General) Update sample APK"
140+ # branch: "apk-update"
141+ # body: |
142+ # This pull request updates the sample APK.
143+ #
144+ # ```
145+ # Version code: ${{ steps.version.outputs.version_code }}
146+ # Version name: ${{ steps.version.outputs.version_name }}
147+ # ```
148+ #
149+ # - name: Clean up artifacts
150+ # if: ${{ always() }}
151+ # run: |
152+ # rm -f previous_apk_hash.txt
153+ # echo "Deleted previous_apk_hash.txt"
154+ # echo "Deleting sample APK..."
155+ # curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/sample.apk"
0 commit comments