Skip to content

Feature Proposal: Refactor flutter-actions-suite into reusable bash functions for GitHub Actions & GitLab CI/CD #5

@Spaccesi

Description

@Spaccesi

Summary

Refactor the existing flutter-actions-suite steps into standalone bash functions so the same logic can be reused across both GitHub Actions workflows, GitLab CI/CD pipelines or other platforms — without duplicating code.

Motivation

Currently, the suite is tightly coupled to GitHub Actions syntax (e.g. uses:, with:, step contexts). This makes it impossible to reuse the same Flutter CI logic in GitLab pipelines or any other CI system without manually porting every step.

Proposed Approach

  • Extract each action's logic into a self-contained bash function inside a shared shell script (e.g. flutter_ci_functions.sh)
  • Each function should rely only on environment variables for configuration (e.g. FLUTTER_VERSION, BUILD_TARGET, ARTIFACT_PATH) so it is CI-system-agnostic
  • GitHub Actions wrappers continue to exist but simply source the script and call the appropriate function
  • GitLab CI jobs can source the same script in before_script / script blocks

Acceptance Criteria

  • All existing GitHub Actions functionality is preserved
  • Each logical step is a named bash function with documented env var inputs
  • A GitLab CI template (.yml) is provided that sources and calls the functions
  • README documents how to use the functions standalone (local dev / other CI)
  • Existing GitHub Actions workflow tests still pass

Notes

  • Functions should be POSIX-compatible where possible, or clearly document bash ≥ 4 requirements
  • Secrets/tokens should always come from env vars, never hardcoded arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions