labview-icon-editor

Introduction

This document is designed to help maintainers, contributors, and engineers automate the build and packaging process for LabVIEW-based projects—particularly the Icon Editor. By following this workflow, you can:

Whether you’re merging a pull request, pushing hotfixes directly, or working on release branches with RC tags, this workflow unifies your packaging pipeline under a single YAML definition. Release creation must be handled separately.

Table of Contents

  1. 1. Overview and Purpose
  2. 2. Environment & Requirements
  3. 3. Action Configuration & Usage
  4. 4. Workflow Details

1. Overview and Purpose

1.1 What Problem Does This GitHub Action Solve?

The Build VI Package workflow provides a consistent, automated build process for LabVIEW-based projects like the Icon Editor. Instead of manually labeling versions, packaging .vip artifacts, and drafting releases, this workflow:

  1. Detects PR labels (major, minor, patch) to decide version increments.
  2. Automatically builds a .vip file using a PowerShell script.
  3. Uploads artifacts for the build; creating tags or GitHub Releases must be handled separately if desired.

It eliminates confusion around versioning, keeps everything in one pipeline, and ensures every commit or merge triggers a reproducible build.

1.2 Why Was It Created & Primary Function

1.3 Intended Users

1.4 High-Level Benefits

2. Environment & Requirements

2.1 Supported Windows OS Versions

2.2 Windows-Specific Prerequisites

2.3 Additional Software & Tools

2.4 Permissions & Credentials

2.5 Hardware/Performance Considerations

3. Action Configuration & Usage

3.1 How the Action Is Triggered

The build-vi-package directory defines a composite action. It does not listen for events on its own; instead, the CI workflow in ci-composite.yml invokes it. That workflow runs on push, pull_request, and workflow_dispatch events. The issue-status and changes jobs run on GitHub-hosted ubuntu-latest. Subsequent jobs that require LabVIEW—apply-deps, version, test, build-ppl, and build-vi-package—execute on a self-hosted Windows runner (self-hosted-windows-lv-ie). Only Windows-specific jobs (e.g., test, build-ppl, build-vi-package) require the self-hosted runner. Linux support is considered a future or custom expansion: you would need to extend the matrix and provide a corresponding runner label (for example, self-hosted-linux-lv). Pushes are limited to main, develop, release-alpha/*, release-beta/*, release-rc/*, feature/*, hotfix/*, and issue-* branches, and pull requests must target one of those branches. However, build-vi-package executes only if the issue-status job allows the pipeline to continue: the source branch name must contain issue-<number> (for example, issue-123 or feature/issue-123) and the linked issue’s Status must be In Progress. For pull requests, the issue-status gate evaluates the PR’s head branch before running the version and build-ppl jobs, which depend on this gate.

3.2 Configurable Inputs / Parameters

ci-composite.yml calls this action and provides all required inputs automatically. When invoking build-vi-package from another workflow, supply the following parameters (see action.yml for details):

Input Description
supported_bitness 32 or 64; selects the VI Package bitness.
labview_version LabVIEW 2021 (21.0).
labview_minor_revision LabVIEW minor revision (defaults to 0).
major Major version component.
minor Minor version component.
patch Patch version component.
build Build number.
commit Commit identifier.
release_notes_file Path to release notes file.
display_information_json DisplayInformation JSON string.

The action automatically uses the first .vipb file found in .github/actions/build-vi-package.

The major, minor, and patch inputs are derived from pull-request labels (major, minor, patch) by the version job (which runs the compute-version action) in ci-composite.yml. If a pull request lacks these labels, the compute-version action defaults to bumping the patch version. For direct pushes without labels, the version components remain unchanged and only the build number increases.

3.3 Customization & Fork Setup

3.4 Artifact Publication

4. Workflow Details

4.1 Pipeline Overview

  1. Check Out & Full Clone
    • Uses actions/checkout@v4 with fetch-depth: 0 so we get the entire commit history (required for the commit-based build number).
  2. Determine Bump Type
    • On PR events, scans the PR labels: major, minor, patch, or defaults to none.
    • If none, no version increment beyond the build number.
  3. Commit-Based Build Number
    • We run git rev-list --count HEAD, storing the integer in new_build_number.
    • This increments automatically with every commit, ensuring a unique build suffix like -build37.
  4. Compute Final Version
    • Merges the label-based bump with existing tags (if any).
    • If on release-alpha/*, release-beta/*, or release-rc/*, appends -alpha.<commitCount>, -beta.<commitCount>, or -rc.<commitCount> respectively. Here <N> equals the commit count, matching compute-version.
    • Always adds -build<BUILD_NUMBER> last, e.g. v1.2.3-rc.37-build37. Because both values use the commit count, the pre-release number and build number are identical.
  5. Build the Icon Editor VI Package
    • Uses the build-lvlibp action to compile the packed libraries.
    • Generates a display-information JSON blob that now includes:
      • semantic-version components (major, minor, patch, build),
      • repository-derived metadata (company/author names, homepage URL, and description), and
      • the markdown release notes captured from Tooling/deployment/release_notes.md.
    • Runs the build-vi-package action to generate the final .vip file with those values embedded.
  6. Capture & Upload Artifacts
    • Uploads the generated .vip as an ephemeral artifact for the current Actions run.

4.2 Version or Tagging Steps

4.3 Pre-Release vs. Final Release

5. Security & Permissions

5.1 Secure Data Handling

  1. GITHUB_TOKEN
    • This workflow relies on GitHub’s ephemeral GITHUB_TOKEN with read permissions to access the repository and upload artifacts.
    • Ensure your repository’s settings under ActionsGeneralWorkflow permissions allow the workflow to read contents and publish artifacts.
  2. LabVIEW License
    • Your self-hosted runner must have a validly licensed copy of LabVIEW. If LabVIEW is not licensed or is missing required modules, the build might fail.
  3. No Long-Term Secrets
    • By default, no additional secrets are stored. The ephemeral GITHUB_TOKEN is enough for standard build tasks.

5.2 Fork & Pull Request Security

6. Maintenance & Administration

6.1 Keeping the Workflow Updated

  1. Actions Versions
    • This workflow references certain actions, like actions/checkout@v4 or actions/github-script@v7. Keep an eye on updates or deprecations. Update to a newer checkout version when the action itself is revised. Some internal actions—such as compute-version—may still pin different releases for compatibility, so mixing versions is expected.
  2. Build Actions
    • If your LabVIEW project evolves or you add steps, keep the build-lvlibp and build-vi-package actions up to date.
  3. Windows Runner Updates
    • Ensure your self-hosted runner OS is patched and has any new LabVIEW versions if your project updates.

6.2 Runner Management

6.3 Adding New Features

6.4 Delegating Workflow Administration

7. Usage & Examples

7.1 Pull Requests with Labels

Example:

  1. PR labeled minor:
    • Previous version: v1.2.3-build45
    • New version on merge: v1.3.0-build46
    • If it’s release-rc/*, might become v1.3.0-rc.46-build46 (release-alpha/* and release-beta/* yield -alpha.<commitCount> and -beta.<commitCount>).

7.2 Direct Push to Main or Develop

7.3 Working on a Release Branch

7.4 Manually Triggering (workflow_dispatch)

8. Testing & Verification

8.1 Fork Testing

  1. Fork the Repo: Copy .github/workflows/ci-composite.yml to your fork.
  2. Push Changes: Create or modify a branch in your fork.
  3. Open PR (optional): If you label it, watch the logs to see if the version increments properly.
  4. Check Artifacts: Ensure a .vip file is built and uploaded as an artifact for your run.

8.2 Main Repo Testing

  1. Merge a labeled PR (e.g., patch) into develop.
  2. Observe the workflow’s console output: the version should increment patch by 1, and the build number increments from commit count.
  3. Verify that the .vip artifact is available. If you run a separate release workflow, confirm that the release was created.

8.3 LabVIEW-Specific QA

9. Troubleshooting

9.1 Common Error Scenarios

  1. No .vip Found
    • Ensure the build-vi-package action completed successfully and produced the artifact.
    • Check action logs for errors in the packaging steps.
  2. LabVIEW Licensing Failure
    • The self-hosted runner might not have a proper LabVIEW license or is missing required toolkits.
    • Check LabVIEW logs or ensure you’ve got the correct environment on that machine.

9.2 Debugging Tips

9.3 Where to Seek Help

10. FAQ

Q: How do I force a “patch” bump if I push directly to develop? A: Use a pull request with the patch label. Direct pushes without PR labels always use the previous version numbers.

Q: How do I override the build number? A: By default, we rely on git rev-list --count HEAD. You can change it by passing a custom environment variable or adjusting the version logic in your workflow.

Q: Does it support alpha/beta channels out of the box? A: Yes. Branches release-alpha/*, release-beta/*, and release-rc/* automatically append -alpha.<commitCount>, -beta.<commitCount>, or -rc.<commitCount> during the “Compute version string” step, so the pre-release number matches the build number.

Q: What about manual triggers?
A: If workflow_dispatch is enabled, you can run it from the Actions tab, typically defaulting to the same logic (none for bump).

Q: Where do I see ephemeral artifacts? A: In the Actions run logs. Look for the “Artifacts” section. If you later create a release and attach the .vip, it becomes permanent under “Assets” on the Release page.

11. Conclusion

By properly setting up environment variables, referencing your LabVIEW environment on a self-hosted runner, and using label-based version increments plus a commit-based build number, this GitHub Action automates your .vip build and artifact upload process. Maintainers can extend the pipeline with tagging or release steps if desired. Follow the troubleshooting steps if anything goes awry, and enjoy streamlined LabVIEW CI/CD!