Pre-release #22
Workflow file for this run
This file contains hidden or 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
| name: Pre-release | |
| on: | |
| release: | |
| types: [published] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build-debug: | |
| runs-on: ubuntu-latest | |
| if: github.event.release.prerelease == true | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # Set Current Date As Env Variable | |
| - name: Set current date as env variable | |
| run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| # Set Repository Name As Env Variable | |
| - name: Set repository name as env variable | |
| run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' # See 'Supported distributions' for available options | |
| java-version: '21' | |
| cache: 'gradle' | |
| - name: Change wrapper permissions | |
| run: chmod +x ./gradlew | |
| - name: Update versions.properties with tag | |
| run: | | |
| # Extract version components from tag (assuming format like v1.2.3) | |
| TAG_VERSION="${{ github.event.release.tag_name }}" | |
| TAG_VERSION="${TAG_VERSION#v}" # Remove 'v' prefix if present | |
| # Split version into components | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$TAG_VERSION" | |
| # Update versions.properties if components exist | |
| if [ ! -z "$MINOR" ]; then | |
| sed -i "s/version_minor = .*/version_minor = $MINOR/" app/versions.properties | |
| fi | |
| if [ ! -z "$PATCH" ]; then | |
| sed -i "s/version_patch = .*/version_patch = $PATCH/" app/versions.properties | |
| fi | |
| # Display updated file | |
| cat app/versions.properties | |
| # Create APK Debug | |
| - name: Build apk debug project (APK) - ${{ env.main_project_module }} module | |
| run: ./gradlew assembleDebug | |
| # Upload Artifact Build | |
| # Noted For Output [main_project_module]/build/outputs/apk/debug/ | |
| - name: Upload APK Debug - ${{ env.repository_name }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.repository_name }} - ${{ env.date_today }} - APK(s) debug generated | |
| path: app/build/outputs/apk/debug/ | |
| - name: Upload artifact to Firebase App Distribution | |
| uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
| with: | |
| appId: ${{secrets.FIREBASE_APP_ID}} | |
| serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
| groups: testers | |
| file: app/build/outputs/apk/debug/app-debug.apk |