Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build release action #2219

Merged
merged 15 commits into from
Aug 3, 2024
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
59 changes: 59 additions & 0 deletions .github/workflows/BuildDebug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Debug APK

on:
workflow_dispatch:

jobs:
build:
name: Build Arcticons APK
runs-on: ubuntu-latest

steps:
- name: Checking out branch
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: gradle
- name: Write sign info
if: github.repository_owner == 'Donnnno'
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Get Gradle
run: gradle wrapper
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Lint Checks
run: |
gradle app:lintNormalDebug
gradle app:lintBlackDebug
gradle app:lintDayNightDebug
gradle app:lintYouDebug
- name: Build debug APK
run: ./gradlew app:assembleDebug
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: |
app/build/outputs/apk/black/debug/*.apk
app/build/outputs/apk/blackPlay/debug/*.apk
app/build/outputs/apk/dayNight/debug/*.apk
app/build/outputs/apk/normal/debug/*.apk
app/build/outputs/apk/normalPlay/debug/*.apk
app/build/outputs/apk/you/debug/*.apk
app/build/outputs/apk/youPlay/debug/*.apk
app/build/reports/*





62 changes: 62 additions & 0 deletions .github/workflows/BuildRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Release

on:
release:
types: [published]
push:
tags:
- "*"

jobs:
build:
name: Build Arcticons APK
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: gradle
- name: Write sign info
if: github.repository_owner == 'Donnnno'
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Get Gradle
run: gradle wrapper
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Normal APK
run: ./gradlew app:assemblenormalRelease
- name: Build Black APK
run: ./gradlew app:assembleblackRelease
- name: Build You APK
run: ./gradlew app:assembleyouRelease
- name: Build Day&Night
run: ./gradlew app:assembledayNightRelease

- name: Get Release Notes
id: image
run: |
name=$(< ./generated/releaseName.txt)
name=$(echo $name | tr '\n' ' ')
image="![releaseImage](https://github.com/Arcticons-Team/Arcticons/blob/$GITHUB_REF_NAME/generated/releaseImage.jpg)"
changelog=$(< ./generated/changelog.md)
changelog="$changelog

$image"
gh release create $GITHUB_REF_NAME --generate-notes --title "$name" --notes "$changelog" --discussion-category "Announcements" app/build/outputs/apk/normal/release/*.apk app/build/outputs/apk/black/release/*.apk app/build/outputs/apk/dayNight/release/*.apk app/build/outputs/apk/you/release/*.apk
env:
GH_TOKEN: ${{ github.token }}



4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.dex
*.pro
*.yml
*.jks
*~

bin/
Expand Down Expand Up @@ -37,3 +38,6 @@ bundletool.jar
.keystore/arcticonskeystore.jks
*.eml
freedesktop-theme/arcticons*
/app/src/main/assets/contributors/downloaded
app/src/main/res/xml/contributors.xml
keystore.properties
34 changes: 28 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,44 @@ android {
targetSdkVersion rootProject.ext.TargetSdk
versionCode 1350
versionName '10.0.5'
multiDexEnabled true
multiDexEnabled true // Naming app bundles
base {
archivesName = "${parent.name}-v${versionName}"
}

// Naming app bundles
setArchivesBaseName("${parent.name}-v${versionName}")
}

// Load keystore
def keystorePropertiesFile = rootProject.file("keystore.properties");
def releaseSigning;
if (keystorePropertiesFile.exists()){
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
releaseSigning = signingConfigs.create("release", signingConfig -> {
signingConfig.setKeyAlias(keystoreProperties.getProperty("keyAlias"));
signingConfig.setKeyPassword(keystoreProperties.getProperty("keyPassword"));
signingConfig.setStoreFile(rootProject.file(keystoreProperties.getProperty("storeFile")));
signingConfig.setStorePassword(keystoreProperties.getProperty("storePassword"));
});
} else {releaseSigning = signingConfigs.named("debug"); // Use getByName for safety
}

buildFeatures {
buildConfig = true
}

buildTypes {
configureEach {
signingConfig = releaseSigning
}
release {
minifyEnabled false
debug {
applicationIdSuffix '.debug'
}
}
debug {
applicationIdSuffix '.debug'
}


applicationVariants.all { variant ->

if (variant.flavorName == "you" || variant.flavorName == "youPlay") {
Expand Down Expand Up @@ -105,12 +125,14 @@ android {
}

buildFeatures {
buildConfig = true
viewBinding true
}
namespace 'com.donnnno.arcticons'
lint {
abortOnError false
checkReleaseBuilds false
lintConfig = file("lint.xml")
}
}

Expand Down
7 changes: 7 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="UnusedResources">
<ignore path="*/res/drawable-nodpi/*" />
<ignore path="*/res/drawable-anydpi/*" />
</issue>
</lint>
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.App.Starting"
tools:replace="android:icon"
>

<meta-data
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/java/com/donnnno/arcticons/applications/CandyBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ public Configuration onInit() {
.append("\r\n")
.append(request.getActivity())
.append("\r\n");

String installerPackage = packageManager.getInstallerPackageName(request.getPackageName());

if (installerPackage != null && installerPackage.equals("com.android.vending")) {
emailBody.append("https://play.google.com/store/apps/details?id=")
.append(request.getPackageName());
} else {
emailBody.append("https://f-droid.org/en/packages/")
.append(request.getPackageName()).append("/");
}
}

return emailBody.toString();
Expand Down
1 change: 1 addition & 0 deletions app/src/normal/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
3 changes: 2 additions & 1 deletion app/src/you/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
7 changes: 7 additions & 0 deletions generated/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### An Awsome Release Title
* :rocket: Many new icons!
* :rainbow:
* :tada: Fixes for icons not applying.
* :fire: 10000 icons in total!
* :sparkles:

Binary file added generated/releaseImage.jpg
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 generated/releaseName.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test Release !!!
9 changes: 7 additions & 2 deletions preparehelper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id("application")
id 'application'
}

application {
mainClassName = "com.donnnno.arcticons.helper.Start"
mainClass.set("com.donnnno.arcticons.helper.Start")
}

tasks.register('runyou', JavaExec) {
Expand Down Expand Up @@ -44,3 +44,8 @@ dependencies {
implementation("commons-io:commons-io:2.15.0")
implementation 'org.sejda.imageio:webp-imageio:0.1.6'
}

java {
sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ public static BufferedImage downloadImages(String imageUrl) {
URL url = new URL(imageUrl);
BufferedImage img = ImageIO.read(url);
if (img != null) {
System.out.println("Downloaded image from: " + imageUrl);
//System.out.println("Downloaded image from: " + imageUrl);
return img;
} else {
System.err.println("Failed to download image from: " + imageUrl);
}
} catch (IOException e) {
System.err.println("Failed to download image from: " + imageUrl + " " + e.getMessage());
//System.err.println("Failed to download image from: " + imageUrl + " " + e.getMessage());
return null;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public static void main(String[] args) {
String categoryGamesXml;
String assetsDir;
String appFilter;
System.out.println("root Dir: " + rootPath);
System.out.println("root Dir Name: " + rootDirName);
//System.out.println("root Dir: " + rootPath);
//System.out.println("root Dir Name: " + rootDirName);
if (args.length > 0) {
String flavor = args[0];
// Use the flavor as needed
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ':preparehelper'
include ':app', ':libs:candybar', ':libs:extLibs:PreLollipopTransitions'
include ':app'