fossasia / badgemagic-android

Badge Magic with LEDs - Android App https://play.google.com/apps/testing/org.fossasia.badgemagic
Apache License 2.0
1.85k stars 206 forks source link

chore: Add Branch Deletion to GitHub Actions Pipeline for Issue #1084

Closed ayushontop closed 3 weeks ago

ayushontop commented 3 weeks ago

This pull request implements automatic branch deletion as part of the GitHub Actions pipeline to address issue #743 This feature ensures that the specified branch is deleted after each successful build or release, helping to keep the repository clean and preventing repository size increase over time.

Feature Overview: Branch Deletion: Deletes the specified branch after each run to avoid clutter and manage repository size effectively. Configured to run as a final job in the workflow. Related Issue: Closes #743

Summary by Sourcery

CI:

sourcery-ai[bot] commented 3 weeks ago

Reviewer's Guide by Sourcery

This PR streamlines the GitHub Actions workflow by implementing automatic branch deletion and simplifying the build process. The changes focus on optimizing the version update process, simplifying artifact handling, and adding a new job to clean up the APK branch after builds.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Simplified version update process in the common workflow
  • Consolidated version name and code updates into more concise commands
  • Simplified git commit message for version updates
  • Improved code organization with clear section comments
.github/workflows/push.yml
Streamlined APK/AAB artifact handling
  • Removed redundant artifact upload steps
  • Simplified file copying and renaming logic
  • Improved branch cleanup process
  • Standardized naming convention for build artifacts
.github/workflows/push.yml
Removed unnecessary workflow steps and jobs
  • Removed Ruby setup and bundler configuration
  • Removed iOS build job
  • Removed screenshot generation job
  • Removed release draft update job
.github/workflows/push.yml
Added automatic APK branch deletion
  • Created new delete-apk-branch job
  • Configured job to run after android build
  • Added force deletion of APK branch
  • Implemented always() condition to ensure cleanup
.github/workflows/push.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#743 Implement automatic APK generation using Github Actions
#743 Delete the apk branch on each new generation

Possibly linked issues


Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
ayushontop commented 3 weeks ago

Hi @adityastic can you please review this PR, Thanks, please let me know if there are any changes to be made

adityastic commented 3 weeks ago

Hey 👋, I don't think we need to remove the apk branch. What is the concern atm? Once we update HEAD by force pushing, the tree ref would not point to the last commits meaning those commits won't be pulled while fetching or updating apk branch in your local repo anyway

adityastic commented 3 weeks ago

Feel free to comment and let's discuss if we need to reopen this pr