Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions .github/scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@


argparser = argparse.ArgumentParser(description='Bump release version')

argparser.add_argument('-c', '--custom',
dest='custom',
help='custom version name and code (format: \'name|code\')')
argparser.add_argument('-r', '--release-type',
dest='release_type',
help='type of release',
Expand Down Expand Up @@ -52,22 +56,25 @@ def build_version_code(version):
with open(target, 'r+') as file:
content = file.read()

version_name = semver.VersionInfo.parse(re.search(regexp_version_name, content).group(1))

if not version_name.prerelease:
match args.version_type:
case 'major': version_name = version_name.bump_major()
case 'minor': version_name = version_name.bump_minor()
case 'patch': version_name = version_name.bump_patch()

if args.release_type == 'prod':
if version_name.prerelease:
version_name = version_name.bump_prerelease(token='beta')
version_code = build_version_code(version_name)
version_name = version_name.finalize_version()
if args.custom:
version_name, version_code = args.custom.split('|')
else:
version_name = version_name.bump_prerelease(token='beta')
version_code = build_version_code(version_name)
version_name = semver.VersionInfo.parse(re.search(regexp_version_name, content).group(1))

if not version_name.prerelease:
match args.version_type:
case 'major': version_name = version_name.bump_major()
case 'minor': version_name = version_name.bump_minor()
case 'patch': version_name = version_name.bump_patch()

if args.release_type == 'prod':
if version_name.prerelease:
version_name = version_name.bump_prerelease(token='beta')
version_code = build_version_code(version_name)
version_name = version_name.finalize_version()
else:
version_name = version_name.bump_prerelease(token='beta')
version_code = build_version_code(version_name)

if not args.env:
print(f'Name: {version_name}')
Expand Down
42 changes: 23 additions & 19 deletions .github/scripts/create_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
parser.add_argument('-r', '--release-type',
dest='release_type',
help='type of release',
choices=['beta', 'prod'],
choices=['prod', 'beta', 'foss'],
default='beta')
parser.add_argument('-p', '--print',
dest='print',
Expand Down Expand Up @@ -54,27 +54,31 @@ def main():
ET.SubElement(resources, 'string', name='changelog_date')
changelog = ET.SubElement(resources, 'string-array', name='changelog')

text = f'{icons_new} new icons, {icons_total} in total'
ET.SubElement(changelog, 'item').text = text
txt.append('- ' + text)

if args.release_type == 'prod':

text = f'Fixed icons not applying properly'
if args.release_type != 'foss':
text = f'{icons_new} new icons, {icons_total} in total'
ET.SubElement(changelog, 'item').text = text
txt.append('- ' + text)

for line in data.splitlines():
line = line.strip()
if not line: continue
line = re.sub('^-+', '', line).strip()
ET.SubElement(changelog, 'item').text = line
txt.append('- ' + line)

else:
text = 'Full changelog will be published upon release!'
ET.SubElement(changelog, 'item').text = text
txt.append('- ' + text)
match args.release_type:
case 'prod':
text = f'Fixed icons not applying properly'
ET.SubElement(changelog, 'item').text = text
txt.append('- ' + text)

for line in data.splitlines():
line = line.strip()
if not line: continue
line = re.sub('^-+', '', line).strip()
ET.SubElement(changelog, 'item').text = line
txt.append('- ' + line)
case 'beta':
text = 'Full changelog will be published upon release!'
ET.SubElement(changelog, 'item').text = text
txt.append('- ' + text)
case 'foss':
text = 'This is a FOSS build for testing purposes!'
ET.SubElement(changelog, 'item').text = text
txt.append('- ' + text)


tree = ET.ElementTree(resources)
Expand Down
71 changes: 15 additions & 56 deletions .github/workflows/build_foss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@ run-name: foss @ ${{ github.sha }}

on:
workflow_dispatch:
inputs:
version_name:
description: Version name
default: 1.0.0
required: true
version_code:
description: Version code
default: '100000'
required: true

concurrency: ${{ github.ref }}

env:
filename: delta-v${{ inputs.version_name }}-foss

jobs:
build:
name: Build
Expand All @@ -27,67 +15,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Export variables
run: |
python -u .github/scripts/resolve_paths.py -p >> $GITHUB_ENV

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 18

- name: Export variables
run: |
python -u .github/scripts/resolve_paths.py -p >> $GITHUB_ENV

- name: Install dependencies
run: |
cd ${{ env.sd }}
sudo pip install -r requirements.txt
sudo pip install -r ${{ env.sd }}/requirements.txt

- name: Add new icons
run: |
cd ${{ env.sd }}
python -u add_icons_wrapper.py
python -u ${{ env.sd }}/add_icons_wrapper.py

- name: Change version
- name: Set version
run: |
python - << EOF
import re

target = 'app/build.gradle'

regexp_version_code = re.compile('versionCode (\d+)')
regexp_version_name = re.compile('versionName "(\d+\.\d+\.\d+(-beta\d+)?)"')

with open(target, 'r+') as file:
content = file.read()
content = re.sub(regexp_version_code, f'versionCode ${{ inputs.version_code }}', content)
content = re.sub(regexp_version_name, f'versionName "${{ inputs.version_name }}"', content)
file.seek(0)
file.write(content)
file.truncate()
EOF
echo "filename=delta-${GITHUB_SHA::7}-foss" >> $GITHUB_ENV
python -u ${{ env.sd }}/bump_version.py -w \
-c "${GITHUB_SHA::7}|$(date +%s)"

- name: Set custom icons count
- name: Set icon count
run: |
drawable_xml=app/src/main/res/xml/drawable.xml
drawable_lines=$(grep '<item' $drawable_xml | sort)
summary=$(echo "$drawable_lines" | wc -l)
amount_all=$(echo "$drawable_lines" | uniq | wc -l)
amount_new=$(( $summary - $amount_all ))
shortcut=java/website/leifs/delta/applications/CandyBar.java
sed -i "s|setCustomIconsCount\(.*\);|setCustomIconsCount\($amount_all\);|" app/src/foss/$shortcut
sed -i "s|setCustomIconsCount\(.*\);|setCustomIconsCount\($amount_all\);|" app/src/play/$shortcut
python ${{ env.sd }}/count_icons.py -w

- name: Create changelog
run: |
cat << EOF > app/src/main/res/values/changelog.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="changelog_date"></string>
<string-array name="changelog">
<item><![CDATA[<font color=#ff837d><item>¯\\_(ツ)_/¯</item></font>]]></item>
</string-array>
</resources>
EOF
python ${{ env.sd }}/create_changelog.py -p -w -r foss \
-x app/src/main/res/values/changelog.xml

- name: Sort appfilter and drawable
run: |
Expand Down Expand Up @@ -124,4 +83,4 @@ jobs:
with:
name: ${{ env.filename }}
path: ${{ env.filename }}.apk
retention-days: 90
retention-days: 7
2 changes: 1 addition & 1 deletion app/src/main/assets/appfilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15866,7 +15866,7 @@
<item component="ComponentInfo{ru.tech.imageresizershrinker/ru.tech.imageresizershrinker.presentation.AppActivity}" drawable="image_toolbox" />
<item component="ComponentInfo{ru.tech.imageresizershrinker/ru.tech.imageresizershrinker.presentation.main_screen.MainActivity}" drawable="image_toolbox" />
<item component="ComponentInfo{ru.tech.papricoin/ru.tech.papricoin.presentation.MainActivity}" drawable="papricoin" />
<item component="ComponentInfo{ru.tele2.mytele2/ru.tele2.mytele2.ui.splash.SplashActivity}" drawable="tele2_ru" />
<item component="ComponentInfo{ru.tele2.mytele2/ru.tele2.mytele2.ui.splash.SplashActivity}" drawable="tele2_ru_alt_1" />
<item component="ComponentInfo{ru.ticketmanager.traktor/crc64a7c86e46ca280763.MainActivity}" drawable="hc_traktor" />
<item component="ComponentInfo{ru.timekillers.plaidy/ru.timekillers.plaidy.activities.StartupActivity}" drawable="plaidy" />
<item component="ComponentInfo{ru.tinkoff.bnpl/ru.tinkoff.bnpl.IconNewYear}" drawable="dolyami" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/drawable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@
<item drawable="tasks_alt_yellow" />
<item drawable="tata_play_alt_1" />
<item drawable="tele2_alt_1" />
<item drawable="tele2_ru_alt_1" />
<item drawable="telegram_alt_1" />
<item drawable="telegram_aqua" />
<item drawable="telegram_nox" />
Expand Down Expand Up @@ -10691,7 +10692,6 @@
<item drawable="telcel" />
<item drawable="telda" />
<item drawable="tele2_kz" />
<item drawable="tele2_ru" />
<item drawable="tele2_se" />
<item drawable="tele_quebec" />
<item drawable="telegraher" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/appfilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15866,7 +15866,7 @@
<item component="ComponentInfo{ru.tech.imageresizershrinker/ru.tech.imageresizershrinker.presentation.AppActivity}" drawable="image_toolbox" />
<item component="ComponentInfo{ru.tech.imageresizershrinker/ru.tech.imageresizershrinker.presentation.main_screen.MainActivity}" drawable="image_toolbox" />
<item component="ComponentInfo{ru.tech.papricoin/ru.tech.papricoin.presentation.MainActivity}" drawable="papricoin" />
<item component="ComponentInfo{ru.tele2.mytele2/ru.tele2.mytele2.ui.splash.SplashActivity}" drawable="tele2_ru" />
<item component="ComponentInfo{ru.tele2.mytele2/ru.tele2.mytele2.ui.splash.SplashActivity}" drawable="tele2_ru_alt_1" />
<item component="ComponentInfo{ru.ticketmanager.traktor/crc64a7c86e46ca280763.MainActivity}" drawable="hc_traktor" />
<item component="ComponentInfo{ru.timekillers.plaidy/ru.timekillers.plaidy.activities.StartupActivity}" drawable="plaidy" />
<item component="ComponentInfo{ru.tinkoff.bnpl/ru.tinkoff.bnpl.IconNewYear}" drawable="dolyami" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/drawable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@
<item drawable="tasks_alt_yellow" />
<item drawable="tata_play_alt_1" />
<item drawable="tele2_alt_1" />
<item drawable="tele2_ru_alt_1" />
<item drawable="telegram_alt_1" />
<item drawable="telegram_aqua" />
<item drawable="telegram_nox" />
Expand Down Expand Up @@ -10691,7 +10692,6 @@
<item drawable="telcel" />
<item drawable="telda" />
<item drawable="tele2_kz" />
<item drawable="tele2_ru" />
<item drawable="tele2_se" />
<item drawable="tele_quebec" />
<item drawable="telegraher" />
Expand Down
38 changes: 37 additions & 1 deletion contribs/icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,40 @@ tiktok_notes:
- com.ss.android.ugc.spark/com.ss.android.ugc.aweme.splash.SplashActivity

opera:
- com.opera.browser/com.opera.Launcher5
- com.opera.browser/com.opera.Launcher5

hotstar:
- in.startv.hotstaronly/com.hotstar.MainActivity

famila_nordost:
- com.famila.nordost/de.paysmard.app.MainActivity

fairwinds:
- com.ifs.banking.fiid1425/com.banking.bankinglibrary.activities.SplashActivity

camera_alt_2:
- com.blackmagicdesign.android.blackmagiccam/com.blackmagicdesign.android.blackmagiccam.ui.MainActivity

benchapp:
- com.benchapp/com.benchapp.MainActivity

sena_motorcycles:
- com.sena.senaneomotorcycles/com.sena.senaneomotorcycles.SenaNeoCyclingActivity

romeo:
- com.planetromeo.android.app/com.planetromeo.android.app.splash.ui.SplashActivity

raccoon_for_lemmy:
- com.livefast.eattrash.raccoonforlemmy.android/com.livefast.eattrash.raccoonforlemmy.android.MainActivity

yandex_weather:
- ru.yandex.weatherplugin/ru.yandex.weatherplugin.ui.common.activity.SplashActivity

tenchat:
- ru.gostinder/ru.gostinder.screens.authorization.phone.AuthActivity

chelindbank:
- ru.ftc.faktura.chelindbank/ru.ftc.faktura.multibank.ui.activity.MainActivity

tele2_ru:
- ru.tele2.mytele2/ru.tele2.mytele2.ui.splash.splashnew.SplashActivity
Binary file added contribs/icons/benchapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions contribs/icons/benchapp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added contribs/icons/chelindbank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions contribs/icons/chelindbank.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added contribs/icons/fairwinds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions contribs/icons/fairwinds.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added contribs/icons/sena_motorcycles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading