I am trying to automate build process of android app, I have stored baseUrl in local.properties file, and passing file content through Github secret, but Github action is keep failing,
build.gradle:
def propFile=rootProject.file("./local.properties")
def properties = new Properties()
properties.load(new FileInputStream(propFile))
def baseUrl = properties['BASEURL']
//getProperty("BASEURL", "")
debug {
buildConfigField 'String', "BASEURL", baseUrl
resValue 'string', "base_url", baseUrl
}
YML:
name: Android CI
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Decode BASEURL
env:
BASEURL: ${{ secrets.BASEURL }}
run: echo BASEURL="$BASEURL" > ./local.properties
- name: Clean
run: ./gradlew clean
- name: Build with Gradle
run: ./gradlew build
How i am passing BASEURL through Github secret
This is log output from Github action Console
local.properties
not at the root of your project when you created it in github actions. Can you doecho BASEURL="$BASEURL" > ./local.properties
, can you also runls -al
to see the layout of the files – Scoundrel