Skip to content

Commit

Permalink
Merge pull request #28 from emreesen27/develop
Browse files Browse the repository at this point in the history
v1.0.0-beta1 is completed
  • Loading branch information
emreesen27 committed Feb 12, 2024
2 parents 78c911f + 351744c commit 67649f4
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: deploy

on:
push:
branches:
- master

jobs:
sign_and_publish:
runs-on: ubuntu-latest
steps:
- name: Fix Git permissions
run: git init
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'true'

- name: Create Google Services JSON
id: create_google_json
uses: jsdaniell/create-json@1.1.2
with:
name: "google-services.json"
json: ${{ secrets.GOOGLE_SERVICES_JSON }}

- name: Move Google Services JSON to App Directory
run: mv google-services.json /home/runner/work/Android-Sn-File-Manager/Android-Sn-File-Manager/app/google-services.json

- name: Build APK with Gradle
run: ./gradlew assembleRelease

- name: Sign app APK
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE_FILE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

# Upload the signed APK as an artifact
- name: Upload Signed APK
uses: actions/upload-artifact@v2
with:
name: Signed app APK
path: ${{ steps.sign_app.outputs.signedReleaseFile }}

- name: Retrieve Version
run: |
VERSION_NAME=$(./gradlew -q printVersionName)
echo "::set-output name=VERSION_NAME::$VERSION_NAME"
id: android_version

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
tag_name: ${{ steps.android_version.outputs.VERSION_NAME }}
release_name: Release ${{ steps.android_version.outputs.VERSION_NAME }}
body: |
This is the release APK for version ${{ steps.android_version.outputs.VERSION_NAME }}.
See here for changes in version -> [Changelog](https://github.com/emreesen27/Android-Sn-File-Manager/blob/master/CHANGELOG)
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.sign_app.outputs.signedReleaseFile }}
asset_name: app-release.apk
asset_content_type: application/vnd.android.package-archive
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## v1.0.0-beta1 (12.02.2024)

* Initial release
10 changes: 8 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ task installCommitMsgHook(type: Copy) {
fileMode 0777
}

task printVersionName {
doLast {
println android.defaultConfig.versionName
}
}

tasks.getByPath(':app:preBuild').dependsOn installGitHooks
tasks.getByPath(':app:preBuild').dependsOn installCommitMsgHook

Expand All @@ -34,7 +40,7 @@ android {
minSdk 26
targetSdk 34
versionCode 1
versionName "1.0.0"
versionName "1.0.0-beta1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -115,4 +121,4 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
}

0 comments on commit 67649f4

Please sign in to comment.