@@ -14,6 +14,8 @@ You maybe not want to auto-build APK for every push, so you can change the workf
1414
1515## How to use
1616
17+ ** Build after every push:**
18+
1719``` yml
1820name : Build project after push
1921
6870 asset_content_type : application/vnd.android.package-archive
6971` ` `
7072
73+ **Build after every comment in issue #1:**
74+
75+ ` ` `
76+ name : Build project after push
77+
78+ on :
79+ issue_comment :
80+ types : [ created, edited ]
81+
82+ jobs :
83+ build :
84+ if : ${{ !github.event.issue.pull_request && github.event.issue.number == 1 }}
85+ runs-on : ubuntu-latest
86+
87+ steps :
88+ - uses : actions/checkout@v3
89+
90+ - name : set up JDK 11
91+ uses : actions/setup-java@v3
92+ with :
93+ java-version : ' 11'
94+ distribution : ' temurin'
95+ cache : gradle
96+
97+ - name : Grant execute permission for gradlew
98+ run : chmod +x gradlew
99+
100+ - name : Build with Gradle
101+ run : ./gradlew build
102+
103+ - name : Build debug APK
104+ run : bash ./gradlew assembleDebug --stacktrace
105+
106+ - name : Check files
107+ run : ls -al app/build/outputs/apk/debug
108+
109+ - name : Create Release
110+ id : create_release
111+ uses : actions/create-release@v1
112+ env :
113+ GITHUB_TOKEN : ${{ secrets.TOKEN }}
114+ with :
115+ tag_name : ${{ github.run_number }}
116+ release_name : ${{ github.event.repository.name }} v${{ github.run_number }}
117+
118+ - name : Upload Release APK
119+ id : upload_release_asset
120+ uses : actions/upload-release-asset@v1.0.1
121+ env :
122+ GITHUB_TOKEN : ${{ secrets.TOKEN }}
123+ with :
124+ upload_url : ${{ steps.create_release.outputs.upload_url }}
125+ asset_path : app/build/outputs/apk/debug/app-debug.apk
126+ asset_name : ${{ github.event.repository.name }}.apk
127+ asset_content_type : application/vnd.android.package-archive
128+ ` ` `
129+
71130Check out the [workflow](.github/workflows/build.yml) for more details.
0 commit comments