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/*.*")
|
||||
for file in files:
|
||||
file_relative = file.replace(sys.argv[1] + "/", "")
|
||||
file_relative = file.replace(project_dir + "/", "")
|
||||
if "-aligned.apk" in file:
|
||||
os.unlink(file)
|
||||
elif "-signed.apk" in file:
|
51
.github/workflows/_build.yml
vendored
51
.github/workflows/_build.yml
vendored
@ -80,49 +80,39 @@ jobs:
|
||||
pycryptodome
|
||||
mysql-connector-python
|
||||
requests
|
||||
- name: Set executable permissions to gradlew
|
||||
run: chmod +x ./gradlew
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
|
||||
- name: Bump nightly version
|
||||
if: ${{ inputs.nightly }}
|
||||
run: python $GITHUB_WORKSPACE/.github/utils/bump_nightly.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
||||
- name: Write signing passwords
|
||||
- name: Write signing passwords and keystore
|
||||
env:
|
||||
DB_HOST: ${{ secrets.DB_HOST }}
|
||||
DB_USER: ${{ secrets.DB_USER }}
|
||||
DB_PASS: ${{ secrets.DB_PASS }}
|
||||
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
|
||||
run: |
|
||||
rm -rf app/release/*
|
||||
rm -rf app/build/outputs/apk/*
|
||||
rm -rf app/build/outputs/bundle/*
|
||||
|
||||
- name: Build APK with Gradle
|
||||
if: ${{ inputs.build-apk }}
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: assembleOfficialRelease
|
||||
- name: Build AAB with Gradle
|
||||
if: ${{ inputs.build-aab }}
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: bundlePlayRelease
|
||||
|
||||
- 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: Build app with Gradle
|
||||
if: ${{ inputs.build-apk || inputs.build-aab }}
|
||||
run: |
|
||||
chmod +x ./gradlew
|
||||
./gradlew \
|
||||
${{ inputs.build-apk && 'assembleOfficialRelease' || '' }} \
|
||||
${{ inputs.build-aab && 'bundlePlayRelease' || '' }} \
|
||||
-P android.injected.signing.store.file=${{ github.workspace }}/keystore.jks \
|
||||
-P android.injected.signing.store.password=${{ secrets.KEY_STORE_PASSWORD }} \
|
||||
-P android.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} \
|
||||
-P android.injected.signing.key.password=${{ secrets.KEY_ALIAS_PASSWORD }}
|
||||
|
||||
- name: Upload release to server
|
||||
if: ${{ inputs.release-ssh }}
|
||||
@ -131,9 +121,12 @@ jobs:
|
||||
REMOTE_HOST: ${{ secrets.SSH_IP }}
|
||||
REMOTE_USER: ${{ secrets.SSH_USERNAME }}
|
||||
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 }}
|
||||
|
||||
- name: Find signed artifacts
|
||||
id: artifacts
|
||||
run: python $GITHUB_WORKSPACE/.github/utils/find_artifacts.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
||||
- name: Extract release changelogs
|
||||
id: changelog
|
||||
run: python $GITHUB_WORKSPACE/.github/utils/extract_changelogs.py $GITHUB_WORKSPACE >> $GITHUB_OUTPUT
|
||||
|
@ -153,9 +153,10 @@ tasks.whenTaskAdded { task ->
|
||||
dependsOn(task.name)
|
||||
duplicatesStrategy DuplicatesStrategy.FAIL
|
||||
from file("${projectDir}/${flavor}/release/"),
|
||||
file("${buildDir}/outputs/mapping/${flavor}Release/"),
|
||||
file("${buildDir}/outputs/bundle/${flavor}Release/")
|
||||
include "*.aab", "*.apk", "mapping.txt", "output-metadata.json"
|
||||
file("${projectDir}/build/outputs/apk/${flavor}/release/"),
|
||||
file("${projectDir}/build/outputs/mapping/${flavor}Release/"),
|
||||
file("${projectDir}/build/outputs/bundle/${flavor}Release/")
|
||||
include "*-release.aab", "*-release.apk", "mapping.txt", "output-metadata.json"
|
||||
destinationDir file("${projectDir}/release/")
|
||||
rename ".+?\\.(.+)", "Edziennik_${android.defaultConfig.versionName}_${flavor}." + '$1'
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user