Basic compile¶
The minimum viable GitHub Actions workflow for building a Business Central extension with ALOps v3. Use this as the starting point for a new repo.
What it does¶
- Checks out the repo.
- Diagnoses the runner with
alops-info(memory, disk, .NET, Docker, BC versions detected). - Compiles every
app.jsonit finds withalops-appcompiler, usingaltool.exefrom the official Microsoft NuGet package. - Uploads the resulting
.appfiles as a workflow artifact.
Hosted runners (windows-latest) are fine for compile-only flows. Compile time on a hosted runner is typically 2–4 minutes for a medium app; expect 30–90 seconds on a self-hosted Windows runner with a warm symbol cache.
The workflow¶
Copy this into .github/workflows/bc-build.yml:
name: BC Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: windows-latest
env:
ALOPS_LICENSEID: ${{ secrets.ALOPS_LICENSEID }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Diagnose runner
uses: HodorNV/ALOps-V3/alops-info@v3 # <!-- TODO: confirm action repo path -->
with:
free_mem_threshold: '20'
free_mem_threshold_action: 'Warn'
docker_containers_action: 'Ignore'
- name: Compile
id: compile
uses: HodorNV/ALOps-V3/alops-appcompiler@v3 # <!-- TODO: confirm action repo path -->
with:
altool_package_version: '17.0.30.49729-beta'
compilation_mode: 'Serial'
alsourcepath: ${{ github.workspace }}
appversiontemplate: '1.0.${{ github.run_number }}.0'
updatebuildnumber: 'true'
- name: Upload .app files
uses: actions/upload-artifact@v4
with:
name: app
path: '**/*.app'
if-no-files-found: error
What to tweak¶
- Runner — switch
windows-latestto[self-hosted, windows]once you have a runner registered. Compile is dramatically faster. altool_package_version— pin to a specific version for reproducible builds. Bump it deliberately when you want a newer compiler.appversiontemplate—1.0.${{ github.run_number }}.0ties the app version to the GitHub run number. Adjust to match your team's versioning convention.- Triggers — narrow
on:to specific paths (e.g.,paths: [src/**, app.json]) on a multi-app monorepo to skip unrelated CI noise.
Next step¶
To install the compiled .app into a running BC service tier as part of the same workflow, see Compile + publish.