-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72949e3
commit c509d43
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
on: | ||
|
||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
name: Extract Android Info | ||
|
||
jobs: | ||
extract-info: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract version from build.gradle | ||
id: extract_version | ||
run: | | ||
# Extract versionCode and versionName from build.gradle | ||
VERSION_CODE=$(grep versionCode app/build.gradle | sed 's/versionCode //') | ||
VERSION_NAME=$(grep versionName app/build.gradle | sed 's/versionName "//;s/"//') | ||
echo "VERSION_CODE=$VERSION_CODE" | ||
echo "VERSION_NAME=$VERSION_NAME" | ||
# Set the extracted values as GitHub Actions outputs | ||
echo "::set-output name=version_code::$VERSION_CODE" | ||
echo "::set-output name=version_name::$VERSION_NAME" | ||
- name: Extract app name from AndroidManifest.xml | ||
id: extract_app_name | ||
run: | | ||
# Extract the app name from AndroidManifest.xml | ||
APP_NAME=$(grep 'android:label' app/src/main/AndroidManifest.xml | sed 's/android:label="@string\///;s/"//') | ||
echo "APP_NAME=$APP_NAME" | ||
# Set the extracted app name as a GitHub Actions output | ||
echo "::set-output name=app_name::$APP_NAME" | ||
- name: Use extracted information | ||
run: | | ||
echo "Version Code: ${{ steps.extract_version.outputs.version_code }}" | ||
echo "Version Name: ${{ steps.extract_version.outputs.version_name }}" | ||
echo "App Name: ${{ steps.extract_app_name.outputs.app_name }}" |