update workflow, add check #379

This commit is contained in:
afischerdev 2021-12-27 20:02:13 +01:00
parent f1b21fc270
commit f5c3103dcf
4 changed files with 28 additions and 3 deletions

View file

@ -12,6 +12,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: BRouter
permissions: permissions:
contents: read contents: read
packages: write packages: write
@ -27,6 +28,17 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup keystore
env:
BROUTER_KEYSTORE_BASE64: ${{ secrets.BROUTER_KEYSTORE_BASE64 }}
run: |
echo $BROUTER_KEYSTORE_BASE64 | base64 -di > ${{ github.workspace }}/brouter.jks
- name: Build with Gradle
env:
ORG_GRADLE_PROJECT_RELEASE_STORE_FILE: ${{ secrets.BROUTER_KEYSTORE_FILE }}
ORG_GRADLE_PROJECT_RELEASE_KEY_ALIAS: ${{ secrets.BROUTER_KEY_ALIAS }}
ORG_GRADLE_PROJECT_RELEASE_KEY_PASSWORD: ${{ secrets.BROUTER_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_RELEASE_STORE_PASSWORD: ${{ secrets.BROUTER_STORE_PASSWORD }}
- name: Build with Gradle - name: Build with Gradle
run: gradle build run: gradle build

View file

@ -13,7 +13,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: BRouter
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 11 - name: Set up JDK 11
@ -24,7 +24,17 @@ jobs:
cache: gradle cache: gradle
- name: Create local.properties - name: Create local.properties
run: touch local.properties run: touch local.properties
- name: Setup keystore
env:
BROUTER_KEYSTORE_BASE64: ${{ secrets.BROUTER_KEYSTORE_BASE64 }}
run: |
echo $BROUTER_KEYSTORE_BASE64 | base64 -di > ${{ github.workspace }}/brouter.jks
- name: Build with Gradle - name: Build with Gradle
env:
ORG_GRADLE_PROJECT_RELEASE_STORE_FILE: ${{ secrets.BROUTER_KEYSTORE_FILE }}
ORG_GRADLE_PROJECT_RELEASE_KEY_ALIAS: ${{ secrets.BROUTER_KEY_ALIAS }}
ORG_GRADLE_PROJECT_RELEASE_KEY_PASSWORD: ${{ secrets.BROUTER_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_RELEASE_STORE_PASSWORD: ${{ secrets.BROUTER_STORE_PASSWORD }}
run: ./gradlew build run: ./gradlew build
- name: Upload ZIP - name: Upload ZIP
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2

View file

@ -596,7 +596,8 @@ public class BRouterActivity extends Activity implements ActivityCompat.OnReques
} }
} }
if (checkExternalStorageWritable()) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
&& checkExternalStorageWritable()) {
res.add(Environment.getExternalStorageDirectory()); res.add(Environment.getExternalStorageDirectory());
} }

View file

@ -204,6 +204,8 @@ public class BRouterView extends View {
// new init is done move old files // new init is done move old files
if (waitingForMigration) { if (waitingForMigration) {
Log.d("BR", "path " + oldMigrationPath + " " + basedir);
if (!oldMigrationPath.equals(basedir + "/brouter"))
moveFolders(oldMigrationPath, basedir + "/brouter"); moveFolders(oldMigrationPath, basedir + "/brouter");
waitingForMigration = false; waitingForMigration = false;
} }