mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 04:46:44 -06:00
[Gradle] Fix copying signed release APK
This commit is contained in:
parent
137ea65e0f
commit
6a7020a516
@ -13,7 +13,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
files = glob.glob(f"{project_dir}/app/release/*.*")
|
files = glob.glob(f"{project_dir}/app/release/*.*")
|
||||||
for file in files:
|
for file in files:
|
||||||
file_relative = file.replace(sys.argv[1] + "/", "")
|
file_relative = file.replace(project_dir + "/", "")
|
||||||
if "-aligned.apk" in file:
|
if "-aligned.apk" in file:
|
||||||
os.unlink(file)
|
os.unlink(file)
|
||||||
elif "-signed.apk" in file:
|
elif "-signed.apk" in file:
|
51
.github/workflows/_build.yml
vendored
51
.github/workflows/_build.yml
vendored
@ -80,49 +80,39 @@ jobs:
|
|||||||
pycryptodome
|
pycryptodome
|
||||||
mysql-connector-python
|
mysql-connector-python
|
||||||
requests
|
requests
|
||||||
- name: Set executable permissions to gradlew
|
- name: Setup Gradle
|
||||||
run: chmod +x ./gradlew
|
uses: gradle/actions/setup-gradle@v3
|
||||||
|
|
||||||
- name: Bump nightly version
|
- name: Bump nightly version
|
||||||
if: ${{ inputs.nightly }}
|
if: ${{ inputs.nightly }}
|
||||||
run: python $GITHUB_WORKSPACE/.github/utils/bump_nightly.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
run: python $GITHUB_WORKSPACE/.github/utils/bump_nightly.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
||||||
- name: Write signing passwords
|
- name: Write signing passwords and keystore
|
||||||
env:
|
env:
|
||||||
DB_HOST: ${{ secrets.DB_HOST }}
|
DB_HOST: ${{ secrets.DB_HOST }}
|
||||||
DB_USER: ${{ secrets.DB_USER }}
|
DB_USER: ${{ secrets.DB_USER }}
|
||||||
DB_PASS: ${{ secrets.DB_PASS }}
|
DB_PASS: ${{ secrets.DB_PASS }}
|
||||||
DB_NAME: ${{ secrets.DB_NAME }}
|
DB_NAME: ${{ secrets.DB_NAME }}
|
||||||
run: python $GITHUB_WORKSPACE/.github/utils/sign.py $GITHUB_WORKSPACE commit >> $GITHUB_OUTPUT
|
KEY_STORE: ${{ secrets.KEY_STORE }}
|
||||||
|
run: |
|
||||||
|
python $GITHUB_WORKSPACE/.github/utils/sign.py $GITHUB_WORKSPACE commit >> $GITHUB_OUTPUT
|
||||||
|
echo $KEY_STORE | base64 --decode > keystore.jks
|
||||||
- name: Clean build artifacts
|
- name: Clean build artifacts
|
||||||
run: |
|
run: |
|
||||||
rm -rf app/release/*
|
rm -rf app/release/*
|
||||||
rm -rf app/build/outputs/apk/*
|
rm -rf app/build/outputs/apk/*
|
||||||
rm -rf app/build/outputs/bundle/*
|
rm -rf app/build/outputs/bundle/*
|
||||||
|
|
||||||
- name: Build APK with Gradle
|
- name: Build app with Gradle
|
||||||
if: ${{ inputs.build-apk }}
|
if: ${{ inputs.build-apk || inputs.build-aab }}
|
||||||
uses: gradle/gradle-build-action@v2
|
run: |
|
||||||
with:
|
chmod +x ./gradlew
|
||||||
arguments: assembleOfficialRelease
|
./gradlew \
|
||||||
- name: Build AAB with Gradle
|
${{ inputs.build-apk && 'assembleOfficialRelease' || '' }} \
|
||||||
if: ${{ inputs.build-aab }}
|
${{ inputs.build-aab && 'bundlePlayRelease' || '' }} \
|
||||||
uses: gradle/gradle-build-action@v2
|
-P android.injected.signing.store.file=${{ github.workspace }}/keystore.jks \
|
||||||
with:
|
-P android.injected.signing.store.password=${{ secrets.KEY_STORE_PASSWORD }} \
|
||||||
arguments: bundlePlayRelease
|
-P android.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} \
|
||||||
|
-P android.injected.signing.key.password=${{ secrets.KEY_ALIAS_PASSWORD }}
|
||||||
- name: Sign build artifacts
|
|
||||||
uses: r0adkll/sign-android-release@v1
|
|
||||||
with:
|
|
||||||
releaseDirectory: app/release
|
|
||||||
signingKeyBase64: ${{ secrets.KEY_STORE }}
|
|
||||||
alias: ${{ secrets.KEY_ALIAS }}
|
|
||||||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
||||||
keyPassword: ${{ secrets.KEY_ALIAS_PASSWORD }}
|
|
||||||
env:
|
|
||||||
BUILD_TOOLS_VERSION: "34.0.0"
|
|
||||||
- name: Rename signed artifacts
|
|
||||||
id: artifacts
|
|
||||||
run: python $GITHUB_WORKSPACE/.github/utils/rename_artifacts.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Upload release to server
|
- name: Upload release to server
|
||||||
if: ${{ inputs.release-ssh }}
|
if: ${{ inputs.release-ssh }}
|
||||||
@ -131,9 +121,12 @@ jobs:
|
|||||||
REMOTE_HOST: ${{ secrets.SSH_IP }}
|
REMOTE_HOST: ${{ secrets.SSH_IP }}
|
||||||
REMOTE_USER: ${{ secrets.SSH_USERNAME }}
|
REMOTE_USER: ${{ secrets.SSH_USERNAME }}
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
|
||||||
SOURCE: ${{ steps.artifacts.outputs.signedReleaseFileRelative }}
|
SOURCE: app/release/
|
||||||
TARGET: ${{ inputs.nightly && secrets.SSH_PATH_NIGHTLY || secrets.SSH_PATH_RELEASE }}
|
TARGET: ${{ inputs.nightly && secrets.SSH_PATH_NIGHTLY || secrets.SSH_PATH_RELEASE }}
|
||||||
|
|
||||||
|
- name: Find signed artifacts
|
||||||
|
id: artifacts
|
||||||
|
run: python $GITHUB_WORKSPACE/.github/utils/find_artifacts.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
||||||
- name: Extract release changelogs
|
- name: Extract release changelogs
|
||||||
id: changelog
|
id: changelog
|
||||||
run: python $GITHUB_WORKSPACE/.github/utils/extract_changelogs.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
run: python $GITHUB_WORKSPACE/.github/utils/extract_changelogs.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
||||||
|
@ -153,9 +153,10 @@ tasks.whenTaskAdded { task ->
|
|||||||
dependsOn(task.name)
|
dependsOn(task.name)
|
||||||
duplicatesStrategy DuplicatesStrategy.FAIL
|
duplicatesStrategy DuplicatesStrategy.FAIL
|
||||||
from file("${projectDir}/${flavor}/release/"),
|
from file("${projectDir}/${flavor}/release/"),
|
||||||
file("${buildDir}/outputs/mapping/${flavor}Release/"),
|
file("${projectDir}/build/outputs/apk/${flavor}/release/"),
|
||||||
file("${buildDir}/outputs/bundle/${flavor}Release/")
|
file("${projectDir}/build/outputs/mapping/${flavor}Release/"),
|
||||||
include "*.aab", "*.apk", "mapping.txt", "output-metadata.json"
|
file("${projectDir}/build/outputs/bundle/${flavor}Release/")
|
||||||
|
include "*-release.aab", "*-release.apk", "mapping.txt", "output-metadata.json"
|
||||||
destinationDir file("${projectDir}/release/")
|
destinationDir file("${projectDir}/release/")
|
||||||
rename ".+?\\.(.+)", "Edziennik_${android.defaultConfig.versionName}_${flavor}." + '$1'
|
rename ".+?\\.(.+)", "Edziennik_${android.defaultConfig.versionName}_${flavor}." + '$1'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user