diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5abbc1db2..329ed0246 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25ba9afc6..c877f1e09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fef544bb5..061ffa6b9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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()