Skip to content

Commit

Permalink
fix(ci): 🐞 debug lint and release jks path fix
Browse files Browse the repository at this point in the history
Signed-off-by: Onuralp SEZER <[email protected]>
  • Loading branch information
onuralpszr committed Jan 17, 2024
1 parent 830c4bf commit b394f62
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/android-ci-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ jobs:
java-version: 17.X

- name: 🧹 Run Android Lint
run: ./gradlew lint -Pandroid.lintOptions.xmlOutput=true
run: ./gradlew lint

- name: 📝 Post Lint Results
uses: actions/github-script@v5
if: always()
if: github.event_name == 'pull_request'
with:
script: |
const fs = require('fs');
const lintResult = fs.readFileSync('./app/build/reports/lint-results.xml', 'utf8');
const lintResult = fs.readFileSync('./app/lint-results.xml', 'utf8');
const issueComment = `
## Lint Results 🧹
\`\`\`
${lintResult}
\`\`\`
`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/android-ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ jobs:
- name: 🗝️ Decode the Keystore
run: echo "${{ secrets.KEYSTORE }}" | base64 --decode > ./keystore.jks

# list files and show pwd for debugging
- name: 📂 List files
run: |
ls -la
pwd
- name: 🏗️ Build Signed APK
run: |
bash ./gradlew assembleRelease --stacktrace \
-Pandroid.injected.signing.store.file=keystore.jks \
-Pandroid.injected.signing.store.file=$GITHUB_WORKSPACE/keystore.jks \
-Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} \
-Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} \
-Pandroid.injected.signing.key.password=${{ secrets.KEY_PASSWORD }}
Expand All @@ -42,15 +48,21 @@ jobs:
with:
name: apk
path: app/build/outputs/apk/release/app-release.apk


- name: Get OpenCV version and versionName
run: |
echo "opencv_version=$(grep -oP 'def opencvVersion = \'\K[^"]+' opencvsdk490/sdk/build.gradle)" >> "$GITHUB_ENV"
echo "version_name=$(grep -oP 'versionName "\K[^"]+' app/build.gradle)" >> "$GITHUB_ENV"
echo "git_hash=$(git rev-parse --verify --short HEAD)" >> "$GITHUB_ENV"
- name: 🏷️ Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: Release ${{ github.ref }} - OpenCV $opencv_version - Version $version_name - Git Hash $git_hash
draft: true
prerelease: false

Expand Down
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
versionName "1.0.1"
buildConfigField("String", "GIT_HASH", "\"${gitCommitHash}\"")

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -52,6 +52,10 @@ android {
baseline = file("lint-baseline.xml")
}

lintOptions {
xmlOutput file("lint-results.xml")
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
Expand Down

0 comments on commit b394f62

Please sign in to comment.