fix: collapse sed replace to single call to avoid file overwriting #149
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: AndroidBuild | |
on: | |
push: | |
branches: | |
- 'build/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.0 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3.13.0 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Grant execute permission for gradlew | |
run: | | |
chmod +x ./gradlew | |
- name: Setup secrets.properties | |
env: | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
SERVICE_KEY: ${{ secrets.SERVICE_KEY }} | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
POWERSYNC_URL: ${{ secrets.POWERSYNC_URL }} | |
TEST: "TEST_CI_VALUE" | |
run: | | |
sed -e "s|SAFE_DEFAULT_VALUE_SUPABASE_KEY|$(echo supabase_key)|g;" \ | |
-e "s|SAFE_DEFAULT_VALUE_SERVICE_KEY|$(echo SERVICE_KEY)|g;" \ | |
-e "s|SAFE_DEFAULT_VALUE_SUPABASE_URL|$(echo SUPABASE_URL)|g;" \ | |
-e "s|SAFE_DEFAULT_VALUE_POWERSYNC_URL|$(echo POWERSYNC_URL)|g;" \ | |
-e "s|TEST_DEFAULT_VALUE|$(echo TEST)|g;" secrets.defaults.properties > secrets.properties | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: periodpals.apk | |
path: app/build/outputs/apk/debug/app-debug.apk | |
- name: Decode Keystore | |
run: echo "${{ secrets.KEYSTORE }}" | base64 --decode > /tmp/keystore.jks | |
- name: Build Release | |
run: ./gradlew assembleDebug |