Browse Source

Merge branch 'release-build' into 'develop'

Create jobs for released versions

See merge request funkwhale/funkwhale-android!76
deploy-in-docker 0.1
Ryan Harg 3 years ago
parent
commit
de9f986897
  1. 46
      .gitlab-ci.yml
  2. 18
      metadata/preview.template.yml
  3. 4
      metadata/release.template.yml

46
.gitlab-ci.yml

@ -28,23 +28,27 @@ stages:
stage: build stage: build
variables: variables:
apk_file: 'app/build/outputs/apk/debug/app-debug.apk' apk_file: 'app/build/outputs/apk/debug/app-debug.apk'
metadata_file: 'metadata/audio.funkwhale.android.yml' metadata_file: 'metadata/audio.funkwhale.android.dev.yml'
metadata_template: 'metadata/preview.template.yml'
output_metadata: 'app/build/outputs/apk/debug/output-metadata.json'
before_script: before_script:
- git fetch --unshallow --tags - git fetch --unshallow --tags
after_script: after_script:
- export versionCode=`$ANDROID_HOME/build-tools/30.0.2/aapt dump badging $apk_file | grep versionCode | awk '{print $3}' | sed s/versionCode=//g | sed s/\'//g` - export versionCode=`$ANDROID_HOME/build-tools/30.0.2/aapt dump badging $apk_file | grep versionCode | awk '{print $3}' | sed s/versionCode=//g | sed s/\'//g`
- apt update && apt install gettext-base - apt update && apt install gettext-base
- cat metadata/template.yml | envsubst > $metadata_file - cat $metadata_template | envsubst > $metadata_file
extends: .gradle-default extends: .gradle-default
artifacts: artifacts:
paths: paths:
- $apk_file - $apk_file
- $metadata_file - $metadata_file
- app/build/outputs/apk/debug/output-metadata.json - $output_metadata
test: test:
extends: .gradle-default extends: .gradle-default
stage: test stage: test
except:
- tags
script: script:
- ./gradlew test jacocoTestReport - ./gradlew test jacocoTestReport
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' $JACOCO_CSV_LOCATION - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' $JACOCO_CSV_LOCATION
@ -63,6 +67,8 @@ coverage:
needs: [ "test" ] needs: [ "test" ]
dependencies: dependencies:
- test - test
except:
- tags
artifacts: artifacts:
reports: reports:
cobertura: $COBERTURA_REPORT cobertura: $COBERTURA_REPORT
@ -70,11 +76,24 @@ coverage:
build-develop: build-develop:
extends: .build extends: .build
script: script:
- echo -n $SIGNING_KEY_STORE | base64 -d > app/android.keystore - echo -n $PREVIEW_SIGNING_KEY_STORE | base64 -d > app/android.keystore
- ./gradlew assembleDebug -Psigning.store=android.keystore -Psigning.store_passphrase=$SIGNING_KEY_PASS -Psigning.key_passphrase=$SIGNING_KEY_PASS - ./gradlew assembleDebug -Psigning.store=android.keystore -Psigning.store_passphrase=$PREVIEW_SIGNING_KEY_PASS -Psigning.key_passphrase=$PREVIEW_SIGNING_KEY_PASS
only: only:
- develop - develop
build-release:
variables:
apk_file: 'app/build/outputs/apk/release/app-release.apk'
output_metadata: 'app/build/outputs/apk/release/output-metadata.json'
metadata_template: 'metadata/release.template.yml'
metadata_file: 'metadata/audio.funkwhale.android.yml'
extends: .build
script:
- echo -n $SIGNING_KEY_STORE | base64 -d > app/android.keystore
- ./gradlew assembleRelease -Psigning.store=android.keystore -Psigning.store_passphrase=$SIGNING_KEY_PASS -Psigning.key_passphrase=$SIGNING_KEY_PASS
only:
- tags
build-bleeding-edge: build-bleeding-edge:
extends: .build extends: .build
script: script:
@ -91,7 +110,22 @@ deploy-develop:
- ssh-add <(echo "$SSH_PRIVATE_KEY") - ssh-add <(echo "$SSH_PRIVATE_KEY")
- scp -o StrictHostKeyChecking=no app/build/outputs/apk/debug/app-debug.apk fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/repo/audio.funkwhale.ffa.dev-$CI_COMMIT_SHORT_SHA.apk - scp -o StrictHostKeyChecking=no app/build/outputs/apk/debug/app-debug.apk fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/repo/audio.funkwhale.ffa.dev-$CI_COMMIT_SHORT_SHA.apk
- scp -o StrictHostKeyChecking=no app/build/outputs/apk/debug/output-metadata.json fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/output-metadata.json - scp -o StrictHostKeyChecking=no app/build/outputs/apk/debug/output-metadata.json fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/output-metadata.json
- scp -o StrictHostKeyChecking=no metadata/audio.funkwhale.android.yml fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/metadata/audio.funkwhale.ffa.dev.yml - scp -o StrictHostKeyChecking=no metadata/audio.funkwhale.android.dev.yml fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/metadata/audio.funkwhale.ffa.dev.yml
- ssh -o StrictHostKeyChecking=no fdroid@apps.funkwhale.audio 'docker run --rm -u $(id -u):$(id -g) -v /srv/fdroid/fdroid/develop:/repo registry.gitlab.com/fdroid/docker-executable-fdroidserver:master update'
tags:
- shell
deploy-release:
stage: deploy
only:
- tags
script:
- eval `ssh-agent -s`
- ssh-add <(echo "$SSH_PRIVATE_KEY")
#- scp -o StrictHostKeyChecking=no app/build/outputs/apk/release/app-release.apk fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/repo/audio.funkwhale.ffa.-$CI_COMMIT_TAG.apk
- scp -o StrictHostKeyChecking=no app/build/outputs/apk/release/app-release.apk fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/repo/audio.funkwhale.ffa.-0.0.1.apk
- scp -o StrictHostKeyChecking=no app/build/outputs/apk/release/output-metadata.json fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/output-metadata.json
- scp -o StrictHostKeyChecking=no metadata/audio.funkwhale.android.yml fdroid@apps.funkwhale.audio:/srv/fdroid/fdroid/develop/metadata/audio.funkwhale.ffa.yml
- ssh -o StrictHostKeyChecking=no fdroid@apps.funkwhale.audio 'docker run --rm -u $(id -u):$(id -g) -v /srv/fdroid/fdroid/develop:/repo registry.gitlab.com/fdroid/docker-executable-fdroidserver:master update' - ssh -o StrictHostKeyChecking=no fdroid@apps.funkwhale.audio 'docker run --rm -u $(id -u):$(id -g) -v /srv/fdroid/fdroid/develop:/repo registry.gitlab.com/fdroid/docker-executable-fdroidserver:master update'
tags: tags:
- shell - shell

18
metadata/preview.template.yml

@ -0,0 +1,18 @@
Categories:
- Multimedia
- Funkwhale
License: MIT
AuthorName: Funkwhale Collective
WebSite: https://funkwhale.audio
SourceCode: https://dev.funkwhale.audio/funkwhale/funkwhale-android/
IssueTracker: https://dev.funkwhale.audio/funkwhale/funkwhale-android/-/issues
Translation: https://translate.funkwhale.audio/projects/funkwhale/ffa/
Name: Funkwhale (preview)
Summary: This is the development version of the official Funkwhale App for Android.
AutoUpdateMode: None
UpdateCheckMode: Tags
UpdateCheckData: output-metadata.json|"version_code":.*"(.*)"|output-metadata.json|"versionName":.*\"(.*)\",
CurrentVersion: $versionCode

4
metadata/template.yml → metadata/release.template.yml

@ -2,13 +2,13 @@ Categories:
- Multimedia - Multimedia
- Funkwhale - Funkwhale
License: MIT License: MIT
AuthorName: Funkwhale AuthorName: Funkwhale Collective
WebSite: https://funkwhale.audio WebSite: https://funkwhale.audio
SourceCode: https://dev.funkwhale.audio/funkwhale/funkwhale-android/ SourceCode: https://dev.funkwhale.audio/funkwhale/funkwhale-android/
IssueTracker: https://dev.funkwhale.audio/funkwhale/funkwhale-android/-/issues IssueTracker: https://dev.funkwhale.audio/funkwhale/funkwhale-android/-/issues
Translation: https://translate.funkwhale.audio/projects/funkwhale/ffa/ Translation: https://translate.funkwhale.audio/projects/funkwhale/ffa/
Name: Funkwhale (preview) Name: Funkwhale
Summary: This is the official and native Android music player for Funkwhale, native Summary: This is the official and native Android music player for Funkwhale, native
to both Android (developed in Kotlin) and to Funkwhale (uses its native API instead to both Android (developed in Kotlin) and to Funkwhale (uses its native API instead
of Subsonic). of Subsonic).
Loading…
Cancel
Save