Skip to content
daybritePublic

About

GitHub actions to support Day projects

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

173 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

daybrite/actions

Build, test, package, and publish Day apps with GitHub Actions. The dayapp workflow runs your app across platforms, captures screenshots, and can publish GitHub releases, upload to app stores, and deploy a project website. The daylib workflow does the same for a piece or part, and also tests and publishes its crates.

I want to… Start here
Build an app in CI Quick start
Run tests and capture the UI Tests and screenshots
Distribute a version GitHub releases
Upload or submit to a store Store uploads
Host a web app and download page Project website
Test and publish a piece or part Pieces and parts
Build a flavor or a self-updating app Flavors and library releases
Add Day steps to an existing workflow Individual actions

Quick start

Add this to your app repository as .github/workflows/ci.yml:

name: ci
on:
  push:
    branches: ["**"]
    tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  app:
    uses: daybrite/actions/.github/workflows/dayapp.yml@v1
    permissions:
      contents: write # Attach packages to GitHub releases on version tags.
    secrets: inherit
    with:
      targets: all

targets: all reads [app] targets from Day.toml. You can name a subset instead: targets: macos-appkit, linux-gtk, android-material, web-dom.

By default, the workflow checks formatting, runs day lint, builds each target, runs scripts from dayscript/*.yaml (or scripts/*.yaml), and packages the app. Each mobile target gets a phone job and a tablet job. A version tag such as v1.2.3 also publishes a GitHub release.

The project must build from a fresh checkout. Use registry or Git dependencies for Day; local paths outside the repository won't exist on the runner. For an app in a subdirectory, set project-path: demo.

The examples below change the calling job's with: block unless they show a complete job. See dayapp.yml for every input, default, and signing secret.

Project names

Before installing toolchains, dayapp and daylib check repository names, Cargo package definitions (including nested workspaces), and app names and titles in Day.toml and flavor manifests. The day- and Day- prefixes are reserved for repositories under daybrite and GitHub forks of those repositories. The Day-Plan/Day-Plan repository has an exception for the exact name Day-Plan, including its lowercase Cargo spelling day-plan. Independent packages and crates should use dayext-. See the contribution guide for the naming policy.

The check uses GitHub's fork ancestry, including forks of forks. A repository URL in Cargo.toml does not establish an exemption. Dependency declarations and Cargo.lock may refer to Day crates. Files ignored by Git are excluded; projects created by setup-command are checked again immediately after generation, including ignored project sources. If reserved names are present and GitHub ancestry cannot be verified, the check fails with instructions to retry. It uses the workflow token's repository metadata access.

Tests and screenshots

Use Rust tests for application logic and DayScript for interactions with the running app. Preflight checks run once on Ubuntu before the platform jobs start. Each platform job then builds the app and runs its scripts on a desktop, simulator, emulator, or browser.

flowchart TD
    checks["Preflight checks"] --> desktop["Desktop jobs"]
    checks --> phone["Phone jobs"]
    checks --> tablet["Tablet jobs"]
    checks --> web["Browser job"]
    desktop & phone & tablet & web --> scripts["DayScript runs in each job"]
    scripts --> reports["DayScript reports"]
    scripts --> shots["Screenshot artifacts"]
Loading

For example, run Rust tests before checking the UI in light and dark themes, in English and French:

with:
  targets: macos-appkit, ios-uikit, android-material, web-dom
  preflight-checks: fmt clippy test
  scripts: dayscript/walkthrough.yaml
  themes: light dark
  locales: en fr

The walkthrough runs four times per device: once for each theme and locale pair. Its screenshot: steps capture the UI. Use locales: all to cover every locale the app ships.

Native scripts each launch the app separately. The first scripted launch builds it; later launches reuse that binary with --skip-build, including scripts-once runs. This preserves cold-start checks without repeating Cargo and Xcode builds. Older CLIs without that flag keep the previous build-per-launch behavior.

Input Use it to…
scripts: none Build and package without running DayScript.
target-scripts Choose scripts per target, such as web-dom: dayscript/browser.yaml.
scripts-once Run selected scripts once, after the theme/locale runs, in the order listed. Useful for tests that consume saved state.
fast-scripts: false Keep decorative animation timing for animation tests.
capture-size: 2880x1800@2 Set desktop and browser screenshot dimensions.
launch-env: DEMO_DATA=1 Pass environment variables to each scripted launch. Values cannot contain spaces.
script-setup Start a local test service or configure emulator ports before scripts run.
grant-permissions Grant device permissions before launch, such as android-material: camera microphone.

Android Maps key

Apps using Google Maps on Android can pass the optional DAY_GOOGLE_MAPS_API_KEY secret to dayapp. It is exposed only to the Android target-setup command, where the app can write an ignored Android resource without printing the value. It is not a signing key; the build jobs still receive no signing material. The secret is unavailable on fork pull requests, so apps must explicitly handle that case or require it for map captures.

secrets:
  DAY_GOOGLE_MAPS_API_KEY: ${{ secrets.DAY_GOOGLE_MAPS_API_KEY }}
with:
  target-setup: |
    android-material: python3 scripts/configure_google_maps.py

Device profiles

Mobile targets use a portrait phone and a landscape tablet by default. Set ios-devices, android-devices, or harmony-devices to replace that target's device list:

with:
  targets: ios-uikit, android-material
  ios-devices: |
    device=iPhone * Pro Max, orientation=portrait, slug=iphone
    device=iPad Pro 13-inch, orientation=landscape, slug=ipad
  android-devices: |
    device=medium_phone, os=36, orientation=portrait, slug=phone
    device=medium_tablet, os=36, orientation=landscape, slug=tablet

Each line creates a parallel job. The first device also produces the target's packages; additional devices produce screenshots and reports. A single line runs just one device.

iOS device names match prefixes and * wildcards; omit os to use the installed runtime. Android names must exist in the runner's avdmanager list device catalog. HarmonyOS accepts phone, tablet, or a pixel size such as 1280x800; its tablet profile tests a wide layout while the emulator still identifies as a phone.

Results and failures

The run's Artifacts include dist-<target> packages and screenshots-<target> captures. Additional devices add their slug to the screenshot artifact name. The DayScript summary shows step outcomes, duration, and sampled memory. Available reports upload even when a job fails; older Day versions without report support are listed as unavailable.

A failed required build or walkthrough blocks releases, signing, store uploads, and website deployment. Use Re-run failed jobs after addressing the failure. After upgrading the workflow reference, start a new run or use Re-run all jobs to pick up the new workflow.

For exploratory coverage, optional=true lets an additional device fail without failing the run. tolerate-failures: true also permits failures in designated coverage work, including macOS GTK/Qt scripts and HarmonyOS emulator runs. It does not ignore every test failure.

Which Day version is tested?

The default day-deps: auto chooses dependencies by event and matches the CLI to them:

Event Day dependencies
Branch push or pull request Default branches of Day and its pieces and parts
Version tag, scheduled run, or manual run Newest published versions allowed by the project's requirements

Set day-deps: published or day-deps: main to make that choice explicit. Use locked to keep the manifest and lockfile unchanged, or a full Day commit SHA to pin Day within a main build. The workflow resolves dependencies once for all platform jobs.

To check compatibility with published Day releases nightly, add a schedule under on:. Use America/New_York so it stays at the same Eastern time through daylight-saving changes:

schedule:
  - cron: "30 1 * * *"
    timezone: America/New_York

Overnight CI scheduling

Daybrite's daily CI starts between 22:00 and 06:00 Eastern to leave the limited macOS runner pool available for daytime development. Repositories starting with lowercase day start on the hour; Day apps start on the half-hour. Other apps use half-hour slots too. Each workflow runs once per night. Push, pull-request, and manual triggers are unchanged.

Stagger larger macOS workloads based on recent job durations. Each repository's workflow defines its schedule.

Scheduled times are requested start times, not reservations. GitHub can delay runs, and long jobs can overlap later slots. During the spring daylight-saving transition, GitHub advances schedules in the skipped hour to the next valid time. See GitHub's schedule documentation.

GitHub releases

A vX.Y.Z tag builds the app and attaches its packages to a GitHub release after all required builds and walkthroughs pass. Configured signing runs before the packages are published.

flowchart TD
    tag["Version tag"] --> ci["Build, test, and package"]
    ci --> sign["Sign packages when configured"]
    sign --> assets["Collect release assets"]
    assets --> mode{"release-mode"}
    mode -->|publish| latest["Latest release"]
    mode -->|pre-release| preview["Public preview"]
    mode -->|draft| draft["Draft for review"]
Loading
release-mode Result
publish (default) Publish the release and make it latest.
pre-release Publish a preview while latest download URLs keep pointing to the previous release.
draft Assemble a draft for someone with repository write access to review and publish.

For a preview release, add release-mode: pre-release. To rebuild the project website when you later promote it to a release, also add this trigger under on::

release:
  types: [released]

That promotion run rebuilds and deploys the website; it doesn't upload to stores or assemble another release. The github-pages environment must allow deployments from the tag.

Release mode only controls the GitHub release. Configured store uploads still run on the tag, including for drafts and pre-releases. Set upload-ios: "false", upload-macos: "false", and upload-play: "false" when you want to hold those uploads.

Release downloads

Package filenames include the target and omit the version, so a latest-download link stays stable, for example: https://github.com/<owner>/<repo>/releases/latest/download/my-app-android-material.aab.

Release asset Contents
Platform packages Installers and archives listed in Targets.
screenshots.tar.xz All captured screenshots, with a merged index.
screenshots-<target>[-<device>].tar.xz Screenshots from one target/device job.
gallery.json, storefront.json Screenshot index and exported store listing data.
SHA256SUMS Checksums for release assets.
Package sidecars Build provenance and software bills of materials for day rebuild.
launch.sh, launch.ps1 Launchers for the desktop packages the release includes.

Extract and verify a screenshot bundle with:

day screenshot unpack screenshots.tar.xz --out screenshots

Desktop launchers let someone try a release without installing a toolchain. They ask before downloading and running the app:

curl -fsSL https://github.com/<owner>/<repo>/releases/latest/download/launch.sh | bash

On Windows, use:

irm https://github.com/<owner>/<repo>/releases/latest/download/launch.ps1 | iex

Signing

Branch and pull request builds use development signing where available; device IPAs are unsigned. On version tags, supplied certificates and keys enable release signing. A signer with incomplete credentials fails the release. Build and test jobs do not receive signing keys.

For signed and notarized macOS downloads, set signing-environment: release-signing and put the macOS signing secrets in that GitHub environment. Store package credentials are repository secrets, forwarded through secrets: inherit.

Signing and upload secrets
Destination Secrets
macOS downloads DAY_MACOS_CERT_P12, DAY_MACOS_CERT_PASSWORD, DAY_SIGN_MACOS_IDENTITY, DAY_NOTARY_KEY_ID, DAY_NOTARY_ISSUER, DAY_NOTARY_KEY_B64
iOS signing DAY_APPLE_CERT_P12, DAY_APPLE_CERT_PASSWORD, DAY_IOS_PROFILE_B64
Mac App Store signing DAY_MAS_CERT_P12, DAY_MAS_CERT_PASSWORD, DAY_MAS_PROFILE_B64
Apple uploads DAY_APPLE_TEAM, DAY_ASC_KEY_ID, DAY_ASC_ISSUER, DAY_ASC_KEY_B64
Android signing DAY_ANDROID_KEYSTORE_B64, DAY_ANDROID_KEY_ALIAS, DAY_KS_PASS, DAY_KEY_PASS
Google Play uploads DAY_PLAY_JSON_KEY (JSON contents)
HarmonyOS signing DAY_OHOS_KEYSTORE_B64, DAY_OHOS_CERT_B64, DAY_OHOS_PROFILE_B64, DAY_OHOS_KEY_ALIAS, DAY_OHOS_KS_PASS, DAY_OHOS_KEY_PASS

Apple provisioning profiles can also be issued using the App Store Connect key and team. The Mac App Store .p12 must contain both Apple Distribution and Mac Installer Distribution identities. See sign-package inputs for details.

Store uploads

On version tags, the workflow can upload iOS, macOS, and Android packages to their stores. It uses store/storefront.toml to generate fastlane lanes, or runs your existing Fastfile. Uploads auto-enable when the listing or lane and the required upload credentials are present. The Mac App Store listing must explicitly name mac-app-store.

flowchart TD
    passed["Required builds and tests pass"] --> signed["Sign the store package"]
    listing["Store listing and selected screenshots"] --> staged["Validate and stage listing"]
    signed & staged --> lane{"Selected fastlane lane"}
    lane -->|upload| upload["Upload for preparation or testing"]
    lane -->|release| submit["Submit to review or production"]
Loading

For an app with store listings and signing/upload secrets configured:

with:
  targets: ios-uikit, macos-appkit, android-material
  upload-ios: "true"
  upload-macos: "true"
  upload-play: "true"
  ios-upload-lane: ios upload
  macos-upload-lane: mac upload
  play-upload-lane: android upload

The upload-* inputs are strings: use quoted "true" or "false". Enabling an upload without its signing credentials fails the run.

The generated lanes distinguish uploading a build from submitting it:

Store Default lane To submit
iOS App Store ios upload: upload without review submission ios release: upload and submit for review
Mac App Store mac upload: upload without review submission mac release: upload and submit for review
Google Play android upload: draft on the internal track android release: completed release on the production track

For example, change ios-upload-lane to ios release when the tag should also submit the app for review. A custom Fastfile controls its own behavior; it receives the package as DAY_IPA, DAY_PKG, or DAY_AAB.

Store screenshots

Uploads leave existing store screenshots alone by default. To replace them with this run's captures, set store-screenshots: true and select screenshot step names in store/storefront.toml:

[storefront.ios-uikit.apple-app-store.screenshots]
iphone = ["home", { name = "editor", theme = "dark" }]
ipad = ["home", "editor"]

[storefront.android-material.google-play-store.screenshots]
default = ["home", "editor"]

Run the scripts in the selected themes and locales. The workflow checks the captures against store rules before upload. The default mobile profiles support this flow; Android tablet captures are scaled during staging to meet the store size requirement. Missing captures or invalid sets fail the upload with a reason.

Automatic screenshot placement requires the generated lanes. If you supply a Fastfile, it must handle screenshot placement. See the store listing guide for listing configuration.

Project website

Set deploy-web: true with web-dom in targets to host the web app on GitHub Pages. Add website/site.toml to publish a daysite project site with downloads, a screenshot gallery, and the web app:

# website/site.toml
host = "https://<owner>.github.io/<repo>"

Give the calling job Pages permissions:

jobs:
  app:
    uses: daybrite/actions/.github/workflows/dayapp.yml@v1
    permissions:
      contents: write
      pages: write
      id-token: write
    secrets: inherit
    with:
      targets: all # Include web-dom in Day.toml.
      deploy-web: true

In repository settings, set Pages → Source → GitHub Actions. For tag deployments, also allow your version tags in Environments → github-pages → Deployment branches and tags.

flowchart LR
    release["Latest release assets"] --> stable["Release pages"]
    preview["Pending pre-release assets"] --> candidate["Preview pages"]
    build["This run's packages and screenshots"] --> dev["Development pages"]
    stable & candidate & dev --> site["Project site with version picker"]
    site --> pages["GitHub Pages"]
Loading

Each release page uses that release's packages and screenshots. Development pages use the current run's artifacts and carry a development notice. A pending pre-release gets a separate tab. Use tab-release, tab-pre-release, and tab-main to choose which tabs appear.

The project site deploys on default-branch pushes and version tags after the required builds pass. Without website/site.toml, deploy-web publishes the bare web app on default-branch pushes. Set web-deploy-tag-pattern to restrict automatic deployment to matching tags.

Use daysite-version to pin the template. Themes and other site settings belong in website/site.toml; see the app website guide and daysite customization guide.

If you call dayapp twice in one run, set deploy-website: "false" on the second call and let one call own release publication with release-assets: false on the other.

Pieces and parts

Add this to a piece's or part's repository as .github/workflows/ci.yml:

name: ci
on:
  push:
    branches: ["**"]
    tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
  pull_request:
  workflow_dispatch:
    inputs:
      day-main:
        description: Build against day's main branch instead of the newest release
        type: boolean
        default: false
  schedule:
    - cron: "0 6 * * *"
      timezone: America/New_York

permissions:
  contents: read

jobs:
  ci:
    uses: daybrite/actions/.github/workflows/daylib.yml@v1
    permissions:
      contents: write
      pages: write
      id-token: write
    secrets: inherit
    with:
      day-main: ${{ inputs.day-main || false }}

daylib reads what to check from the repository's manifests:

Job What it runs
host cargo clippy and cargo test on Linux, macOS, and Windows, plus cargo clippy --features <toolkit> on the OS each toolkit feature draws on (gtk and qt on Linux, appkit on macOS, winui on Windows), with that toolkit's libraries installed. cargo fmt --check runs once.
cross-check cargo clippy --target <triple> for each of iOS, Android, HarmonyOS, and the web that the demo's Day.toml declares, with the matching toolkit feature (uikit, material, arkui, dom) when a crate has one.
demo The app in demo/ through dayapp: built, packaged, and run through its dayscripts on every target in its Day.toml, released on a version tag.
publish On a version tag, the crates to crates.io once host and cross-check pass. It does not wait for the demo.

A library without a demo/Day.toml skips the demo, and its toolkit features name the targets to cross-check; with neither, it is checked for every mobile and web target.

Which Day each run builds against depends on the event. A push or pull request builds against the head of day's main and of every other Day repository's default branch. A scheduled run, a manual run, and a version tag build against the newest releases on crates.io. Run the workflow by hand with day-main checked to build against main instead. One run resolves Day once, so every job builds against the same commit or release.

The other inputs cover what a manifest doesn't say:

Input Use
feature-sets Extra cargo arguments to lint and test with, one set per line (--features demo-provider, --no-default-features).
target-packages System packages per target (linux-gtk, linux-qt: gstreamer1.0-libav), installed for the host, cross-check, and demo jobs of those targets.
targets The targets to build and cross-check, instead of all of the demo's.
extra-targets Also build and walk through the demo's macos-gtk and macos-qt targets, which targets: all leaves out.
publish, publish-paths Turn publishing off, or name the workspaces to publish. By default these are ., then any directory beside it whose package depends on it by path, such as gallery.
scripts, target-scripts, target-setup, script-setup, launch-env, grant-permissions, themes, ios-devices, android-devices, deploy-web, preflight-checks Passed to dayapp for the demo. The device defaults are one iPhone and one Android phone.

A repository with checks of its own adds jobs beside ci. When those jobs must also gate the release, set publish: false and add a publish job with the longer needs:. See publish-crates for the steps.

Before the first release, configure each crate's Trusted Publisher on crates.io with this repository, the workflow file ci.yml, and the environment release. A crate name crates.io has never seen needs one release by hand first. Versions come from the manifests; a version already on crates.io is skipped, so a re-run finishes an interrupted release.

Flavors and library releases

Build a free, paid, or customer-specific version by adding a Day-<name>.toml beside Day.toml:

with:
  targets: all
  flavors: paid
  release-flavor: paid
  store-flavor: paid

flavors adds builds alongside the base app. release-flavor attaches that flavor's packages to the GitHub release; store-flavor selects its packages and listing for store uploads. Omit those two inputs to keep the extra builds as CI artifacts. See build flavors for the app configuration.

A piece or part publishes its crates through daylib. dayapp's publish-crates: true (with publish-crates-paths) publishes from inside the app workflow instead, after every build leg has passed.

For desktop self-updates, post-pack-command can stage helper files and update metadata. update-signing: true signs that metadata after platform signing; macos-update-zip adds a signed update archive. Configure update-public-key, update-application-id, and DAY_UPDATE_PRIVATE_KEY in the signing environment. See the workflow inputs and sign-updates action for the metadata requirements.

Individual actions

Use these actions as steps when you already have a workflow. Each link lists its inputs and outputs.

Action Purpose
check-crate-names Enforce reserved project names and reject retired Day crate names and imports.
setup-day-deps Install a target's libraries, SDKs, and optional packaging tools.
setup-day-cli Install a released CLI, build one from Git, or download a run artifact; export DAY_BIN.
day-deps Select published, main, or locked Day dependencies before Cargo commands.
sign-package Sign an existing iOS, Android, HarmonyOS, or Mac App Store package.
store-upload Stage a listing and run a fastlane lane with a signed package.
publish-crates Publish workspace crates through Trusted Publishing.
plan-lib Read a piece's or part's manifests into daylib's host, cross-target, and publish plans.
sign-updates Sign desktop update metadata.
dayscript-report-summary Summarize DayScript reports in the GitHub run.

For example, run a library's host tests against published Day dependencies:

jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: daybrite/actions/.github/actions/day-deps@v1
        with:
          day-deps: published
      - run: cargo test

Targets

Target Runner Packages / test environment
macos-appkit xcode-27 .dmg; native desktop
ios-uikit xcode-27 .ipa; iOS Simulator
linux-gtk, linux-qt ubuntu-latest .flatpak and .appimage; virtual display
windows-winui windows-latest .msix and NSIS installer; native desktop
android-material ubuntu-latest .apk and .aab; Android emulator
harmony-arkui ubuntu-latest .hap; Oniro emulator
web-dom ubuntu-latest Web distribution ZIP; headless Chromium
macos-gtk, macos-qt xcode-27 Build and script coverage; packaging unavailable

Use target-packages for extra system dependencies and target-setup for commands before a target builds. setup-command is for generating a project during the run; it skips preflight, dependency resolution, and the clean-checkout check.

Windows runners have no audio endpoint, so scripts that require audio-only playback need a platform skip. HarmonyOS WebView support and emulator limitations are described in setup-harmony-webview.

This repository's validation workflow scaffolds a fresh app and checks the reusable build/package workflow on the primary targets.

About

GitHub actions to support Day projects

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages