mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 14:52:13 -04:00
fix automated releasing (+16 squashed commit)
Squashed commit: [70133ca8] correct syntax [f6f14aff] fix syntax error [214f2ca7] use alternate github release action and make nightly publishing non dependent [833556e9] copy tag setting code verbatim [5469b58a] inline varaible again [1dbcde3e] use alternate method for env setting [15976cea] inline outputName [f1d5e67e] supply credentials for release building [79de8bca] disable playstore publishing and debug env variable [331cd82e] fix naming on download.kiwix [d517e5e7] upload zip of all artifacts [9425c650] fix naming on download.kiwix.org [f736f4d1] update github release publishing [4a0ab46e] fix publishing to kiwix.download.org [dc19b3b6] update build variable [e01e106a] bump patch version
This commit is contained in:
parent
23b0cadadd
commit
2066aabc2d
6
.github/workflows/nightly.yml
vendored
6
.github/workflows/nightly.yml
vendored
@ -28,7 +28,6 @@ jobs:
|
||||
script: ./gradlew connectedDebugAndroidTest
|
||||
|
||||
unit_test_and_release:
|
||||
needs: instrumentation_tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@ -48,11 +47,14 @@ jobs:
|
||||
ssh_key: ${{ secrets.ssh_key }}
|
||||
run: |
|
||||
echo "$ssh_key" | base64 -d > ssh_key
|
||||
chmod 600 ssh_key
|
||||
|
||||
- name: Set date variable
|
||||
run: echo ::set-env name=DATE::$(echo $(date +%Y-%m-%d))
|
||||
|
||||
- name: release debug to kiwix.download.org
|
||||
env:
|
||||
UNIVERSAL_DEBUG_APK: app/build/outputs/apk/debug/*universal*.apk
|
||||
DATE: $(echo $(date +%Y-%m-%d))
|
||||
run: |
|
||||
mkdir $DATE
|
||||
cp $UNIVERSAL_DEBUG_APK $DATE
|
||||
|
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@ -26,6 +26,10 @@ jobs:
|
||||
echo "$google_json" | base64 -d > google.json
|
||||
echo "$keystore" | base64 -d > kiwix-android.keystore
|
||||
echo "$ssh_key" | base64 -d > ssh_key
|
||||
chmod 600 ssh_key
|
||||
|
||||
- name: Set tag variable
|
||||
run: echo ::set-env name=TAG::$(echo ${GITHUB_REF:10})
|
||||
|
||||
- name: Publish app to play store
|
||||
env:
|
||||
@ -37,30 +41,14 @@ jobs:
|
||||
- name: Publish app to download.kiwix.org
|
||||
env:
|
||||
UNIVERSAL_RELEASE_APK: app/build/outputs/apk/release/*universal*.apk
|
||||
TAG: $(echo ${GITHUB_REF:10})
|
||||
OUTPUT_NAME: kiwix-$TAG.apk
|
||||
run: |
|
||||
cp $UNIVERSAL_RELEASE_APK $OUTPUT_NAME
|
||||
scp -vrp -i ssh_key -o StrictHostKeyChecking=no $OUTPUT_NAME ci@download.kiwix.org:/data/download/release/kiwix-android/
|
||||
cp $UNIVERSAL_RELEASE_APK kiwix-${TAG}.apk
|
||||
scp -vrp -i ssh_key -o StrictHostKeyChecking=no kiwix-${TAG}.apk ci@download.kiwix.org:/data/download/release/kiwix-android/
|
||||
|
||||
- name: Create Github Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1.0.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish to github releases
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
artifacts: "app/build/outputs/apk/release/**"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
draft: true
|
||||
prerelease: true
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OUTPUT_DIR: ${{app/build/outputs/apk}}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: $OUTPUT_DIR
|
||||
asset_name: assets.zip
|
||||
asset_content_type: application/vnd.android.package-archive
|
||||
|
@ -11,7 +11,7 @@ apply(from = rootProject.file("jacoco.gradle"))
|
||||
ext {
|
||||
set("versionMajor", 3)
|
||||
set("versionMinor", 1)
|
||||
set("versionPatch", 2)
|
||||
set("versionPatch", 3)
|
||||
}
|
||||
|
||||
fun generateVersionName() = "${ext["versionMajor"]}.${ext["versionMinor"]}.${ext["versionPatch"]}"
|
||||
@ -34,12 +34,12 @@ fun generateVersionCode() =
|
||||
((ext["versionMinor"] as Int) * 100) +
|
||||
ext["versionPatch"] as Int
|
||||
|
||||
val buildNumber get() = System.getenv("TRAVIS_BUILD_NUMBER") ?: "dev"
|
||||
val apkPrefix get() = System.getenv("TAG") ?: "dev"
|
||||
|
||||
android {
|
||||
|
||||
defaultConfig {
|
||||
base.archivesBaseName = buildNumber
|
||||
base.archivesBaseName = apkPrefix
|
||||
resValue("string", "app_name", "Kiwix")
|
||||
resValue("string", "app_search_string", "Search Kiwix")
|
||||
versionCode = generateVersionCode()
|
||||
|
Loading…
x
Reference in New Issue
Block a user