Skip to content

Commit

Permalink
Add CI for pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Oct 28, 2024
1 parent 7fb7af8 commit 9350491
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: πŸŒ™ Nightly Build

on:
workflow_dispatch:
push:
branches:
- master

jobs:
buildAndroid:
permissions: write-all
name: πŸ€–πŸ“¦ Build Android APK
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3

- name: βš™οΈ Setup Java
uses: actions/setup-java@v3
with:
java-version: "21.x"
cache: 'gradle'
distribution: 'adopt'
id: java

- name: πŸ” Retrieve base64 keystore and decode it to a file
id: write_file
uses: timheuer/[email protected]
with:
fileName: "android-keystore.jks"
fileDir: "${{ github.workspace }}/"
encodedString: ${{ secrets.KEYSTORE_FILE_BASE64 }}

- name: πŸ“πŸ” Create keystore.properties file
env:
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/key.properties
run: |
echo "storeFile=${{ github.workspace }}/android-keystore.jks" > $KEYSTORE_PROPERTIES_PATH
echo "keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}" >> $KEYSTORE_PROPERTIES_PATH
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH
echo "keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH
- name: πŸ€–πŸ“¦ Create Android release
run: |
./gradlew app:assembleRelease
- name: πŸ“ Generate build date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: πŸ“ Rename APK to ZIP
run: |
cd app/build/outputs/apk/release/
mv *.apk "app-release-${{ steps.date.outputs.date }}.zip"
- name: πŸš€ Upload build artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-release-${{ steps.date.outputs.date }}.zip
asset_name: canta-app-release-${{ steps.date.outputs.date }}.zip
asset_content_type: application/zip

0 comments on commit 9350491

Please sign in to comment.