Update actions/checkout action to v4.2.1 #336
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Write sign info | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'Super12138/ToDo' | |
run: | | |
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then | |
echo releaseStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties | |
echo releaseKeyAlias='${{ secrets.ALIAS }}' >> gradle.properties | |
echo releaseKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties | |
echo releaseStoreFile='${{ github.workspace }}/key.jks' >> gradle.properties | |
echo ${{ secrets.SIGNING_KEY }} | base64 --decode > ${{ github.workspace }}/key.jks | |
fi | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease | |
- name: Upload APK | |
if: success() && github.event_name != 'pull_request' && github.repository == 'Super12138/ToDo' | |
uses: actions/[email protected] | |
with: | |
name: Release | |
path: ${{ github.workspace }}/app/build/outputs/apk/release |