Local Workflows
English | 简体中文
fastforge workflow discovers, validates, and runs YAML workflows, conventionally kept under .fastforge/workflows/. Use it to organize build, package, publish, and ordinary shell steps into repeatable tasks.
Directory Structure
your-project/
├── .fastforge/
│ └── workflows/
│ ├── android.yml
│ └── release.yml
└── project-files
Minimal Workflow
name: Android package
on:
workflow_dispatch:
inputs:
flavor:
description: Build flavor
default: production
jobs:
package:
name: Package Android app
steps:
- name: Create APK
uses: fastforgedev/actions/package
with:
platform: android
target: apk
output: dist/
build-args: '{"flavor":"${{ inputs.flavor }}"}'
Discover Workflows
fastforge workflow list
fastforge workflow list --verbose
fastforge workflow list --dir /path/to/project
Discovery reads *.yml and *.yaml files from three directories under the project (or --workspace for run), in this order:
.fastforge/workflows/.minact/workflows/.github/workflows/
GitHub Actions files therefore count too: a project with CI workflows usually needs --file, and a bare fastforge workflow run in a project whose only workflow is under .github/workflows/ runs that file locally. Files that fail to parse are skipped with a warning and do not appear in list; run validate on them to see the error.
Validate a Workflow
fastforge workflow validate .fastforge/workflows/release.yml
Validation parses the YAML and checks the workflow structure: at least one job, every job has steps, and each step has exactly one of uses or run. It exits with a nonzero status when the file is invalid. It does not run commands or actions, and action inputs (such as the required platform/target, or whether build-args is valid JSON) are only checked at run time.
Run a Workflow
When discovery finds exactly one workflow:
fastforge workflow run
When several workflows are found, select a file explicitly (the path is relative to the current directory):
fastforge workflow run --file .fastforge/workflows/release.yml
Pass workflow_dispatch inputs:
fastforge workflow run \
--file .fastforge/workflows/release.yml \
--input flavor=staging \
--input channel=beta
Simulate an event or change the working directory:
fastforge workflow run \
--file .fastforge/workflows/release.yml \
--event push \
--workspace /path/to/project
fastforgedev/actions/package Action
Required inputs:
| Input | Description |
|---|---|
platform |
Target platform |
target |
Package format |
Optional inputs:
| Input | Description |
|---|---|
output |
Output directory; defaults to dist/ |
artifact-name |
Artifact name template |
skip-clean |
Skip cleaning when the string is true |
channel |
Channel name used in the artifact name |
build-target |
Flutter Builder entry point |
build-args |
JSON object string |
hook-pre |
Shell command to run before packaging |
hook-post |
Shell command to run after packaging |
notarize |
Notarize macOS DMG, PKG, and ZIP when the string is true |
input-dir selects a prebuilt Windows or Linux application directory. Also set app-name, app-binary (omit the Windows .exe suffix), and app-version when using this input. In this mode, the action uses the directory directly and accepts channel for artifact naming.
skip-clean applies to Flutter builds. Flutter builds and prebuilt directories support channel. The action takes the output directory from output and merges workflow, job and step variables with the process environment. Process variables take precedence.
The active builder determines the fields accepted by build-args. See Gradle Builder, Xcode Builder, .NET Builder, and Flutter Builder.
Example:
- name: Package
uses: fastforgedev/actions/package
with:
platform: android
target: aab
output: artifacts/
artifact-name: "my-app-{{build_name}}.{{ext}}"
build-args: '{"flavor":"production","module":"app"}'
hook-post: ./scripts/verify-artifact.sh
Action outputs:
artifact-countartifact-paths(comma-separated)
fastforgedev/actions/publish Action
Required inputs:
| Input | Description |
|---|---|
path |
File or directory to publish |
target |
Publishing target |
Publishing parameters can be grouped in a JSON object whose values are all strings (numbers and booleans must be quoted, e.g. "draft":"true"):
- name: Publish
uses: fastforgedev/actions/publish
with:
path: dist/app.zip
target: github
publish-args: '{"repo":"owner/repository","release-tag":"v1.0.0"}'
If publish-args is omitted, every other with field except path and target becomes a publishing parameter:
- name: Publish
uses: fastforgedev/actions/publish
with:
path: dist/app.zip
target: github
repo: owner/repository
release-tag: v1.0.0
The action outputs message.
Supported Syntax
The engine follows GitHub Actions syntax. Besides the three Fastforge actions (fastforgedev/actions/setup, fastforgedev/actions/package, fastforgedev/actions/publish) — which match both bare names and @ref forms such as fastforgedev/actions/package@main so the same workflow runs locally and on GitHub Actions — it supports:
runsteps (withshell,working-directory,env), plusif,continue-on-error, andtimeout-minuteson steps- job
needs,if,outputs, andstrategy.matrix;${{ }}expressions overinputs,env,steps,needs,matrix,strategy,job,runner, andgithub(secretsandvarsalways evaluate to empty strings) uses:resolves, in order, to a built-in action (fastforgedev/actions/setup,fastforgedev/actions/package,fastforgedev/actions/publish,actions/checkout,actions/cache,actions/upload-artifact,actions/download-artifact), a local./pathaction with anaction.yml, adocker://image, or a remoteowner/repo@refaction. Remote actions are fetched over the network and cached in~/.minact/actions.
Jobs run on this machine. runs-on does not select a runner: a label that doesn't match this machine only prints a warning. A job with container: runs its steps in that Docker image, and services: are not started. The engine keeps its scratch files in .minact/_work/ under the workspace.
A build system Fastforge does not integrate can run as a run step, with its artifact path passed to a fastforgedev/actions/publish step.
Execution Result
The workflow engine creates execution layers from dependencies and reports job, step, command, and action status as it proceeds. Any failure makes the final result fail with a nonzero exit status, so workflows can be used directly from local scripts or CI.
Notes
build-argsandpublish-argsmust be valid JSON, not YAML objects.- The built-in package action has the same current packaging coverage as the CLI.
- Pass publishing credentials through environment variables on the running process.
fastforgedev/actions/publishreads only the process environment, notenv:from the workflow, andwithvalues are printed in the run log. - When multiple workflows exist, use
--fileexplicitly to avoid ambiguity.