Skip to content

Commit

Permalink
chore: update build
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Jan 29, 2024
1 parent b115643 commit 1b4774e
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 60 deletions.
34 changes: 4 additions & 30 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,17 @@ jobs:
- name: Setup semantic-release
run: npm install

- name: Get version code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release --extends ./.releaserc.getversion.json --no-ci --dry-run
echo "RELEASE_VERSION=v$(cat .VERSION)" >> $GITHUB_ENV
- name: Bump pubspec version
run: |
VERSION=$(echo "${RELEASE_VERSION}" | sed 's/v//')
IFS='.' read -r -a nums <<< "${VERSION/-dev/}.0"
VERSIONCODE=$((nums[0] * 100000000 + nums[1] * 100000 + nums[2] * 100 + nums[3]))
sed -i "/^version/c\\version: $VERSION+$VERSIONCODE" pubspec.yaml
- name: Set up Flutter
run: flutter pub get

- name: Generate files with Builder
run: dart run build_runner build --delete-conflicting-outputs

- name: Build with Flutter
run: flutter build apk

- name: Sign APK
id: sign_apk
uses: ilharp/sign-android-release@v1
with:
releaseDir: build/app/outputs/apk/release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
signingKey: ${{ secrets.SIGNING_KEYSTORE }}
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}

- name: Rename APK
run: mv ${{steps.sign_apk.outputs.signedFile}} revanced-manager-${{ env.RELEASE_VERSION }}.apk

- name: Publish release APK
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --extends ./.releaserc.release.json
run: npx semantic-release
14 changes: 13 additions & 1 deletion .releaserc.release.json → .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
],
"@semantic-release/changelog",
"@semantic-release/release-notes-generator",
[
"@droidsolutions-oss/semantic-release-update-file",
{
"files": [
{
"path": ["pubspec.yaml"],
"type": "flutter",
"branches": ["main", "dev"]
}
]
}
],
[
"@semantic-release/git",
{
Expand All @@ -29,7 +41,7 @@
{
"assets": [
{
"path": "revanced-manager-v*.apk"
"path": "build/app/outputs/apk/release/revanced-manager*.apk"
}
],
"successComment": false
Expand Down
24 changes: 0 additions & 24 deletions .releaserc.getversion.json

This file was deleted.

24 changes: 22 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,31 @@ android {
release {
shrinkResources false
minifyEnabled false
resValue "string", "app_name", "ReVanced Manager"
signingConfig signingConfigs.debug

ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
}
if (System.getenv("signingKey") != null) {
signingConfigs {
create("release") {
storeFile = file(System.getenv("signingKey"))
storePassword = System.getenv("keyStorePassword")
keyAlias = System.getenv("keyAlias")
keyPassword = System.getenv("keyPassword")
}
}
signingConfig = signingConfigs.release
resValue "string", "app_name", "ReVanced Manager"
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "revanced-manager-v${flutterVersionName}.apk"
}
}
} else {
signingConfig = signingConfigs.debug
resValue "string", "app_name", "ReVanced Manager Debug"
applicationIdSuffix ".debug"
}
}
debug {
shrinkResources false
Expand Down
Loading

0 comments on commit 1b4774e

Please sign in to comment.