[PR #108] [MERGED] Run approved-PR CI builds with PR-stamped UF2 version metadata #204

Closed
opened 2026-10-22 05:07:32 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/108
Author: @Copilot
Created: 7/3/2026
Status: ✅ Merged
Merged: 7/3/2026
Merged by: @safijari

Base: main ← Head: copilot/tag-version-091


📝 Commits (9)

  • 2a41f58 feat: add semver-driven release tagging
  • c5a21dc style: format webusb build-id fallback line
  • eff673c chore: tighten provenance comments
  • 726e900 fix: tighten semver tag filters
  • 73a748a fix: clarify version bootstrap and fallback check
  • 88a9095 fix: harden semver matching for version tags
  • 342ea2d fix: validate pushed tags before release build
  • 46f2565 Trigger build on PR approval with PR-specific versioning
  • ce1c485 Run approved PR builds with PR-aware UF2 version metadata

📊 Changes

7 files changed (+157 additions, -31 deletions)

View changed files

📝 .github/workflows/build.yml (+41 -0)
📝 .github/workflows/release.yml (+77 -10)
📝 OpenPuck/build_info.h (+8 -4)
📝 OpenPuck/webusb_config.cpp (+9 -7)
📝 docs/BUILD_AND_DEPLOY.md (+1 -1)
📝 docs/index.html (+5 -5)
📝 gen_version.sh (+16 -4)

📄 Description

Approved PRs were not guaranteed to produce UF2 artifacts with PR-identifiable version metadata. This updates CI so approval events trigger the build path and embeds base version + PR number + commit into build identity.

  • Approved review trigger path

    • Added pull_request_review (submitted) to the build workflow.
    • Gated job execution so review-triggered runs proceed only when review.state == approved.
    • Kept the existing UF2 generation + artifact upload path in this run type.
  • PR-specific version identity

    • Added a Resolve build version step to compute:
      • BASE_VERSION from latest semver tag (fallback 0.9.1)
      • PR builds as: <base>-pr<PR_NUMBER>+<SHORT_SHA>
    • Wired the computed value into gen_version.sh via OPK_BUILD_VERSION.
    • Resolved PR number and head SHA correctly for both pull_request and pull_request_review payload shapes.
  • Workflow token scope

    • Added explicit workflow permissions:
      • contents: read
pull_request_review:
  types: [submitted]

jobs:
  compile:
    if: github.event_name != 'pull_request_review' || github.event.review.state == 'approved'
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha || github.event.review.pull_request.head.sha || github.sha }}

      - name: Resolve build version
        env:
          PR_NUMBER: ${{ github.event.pull_request.number || github.event.review.pull_request.number || '' }}
          HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.review.pull_request.head.sha || github.sha }}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/108 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 7/3/2026 **Status:** ✅ Merged **Merged:** 7/3/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `copilot/tag-version-091` --- ### 📝 Commits (9) - [`2a41f58`](https://github.com/safijari/openpuck/commit/2a41f589a97248f53cfda512a646306c805c6dd2) feat: add semver-driven release tagging - [`c5a21dc`](https://github.com/safijari/openpuck/commit/c5a21dc3d01776d60cf61888d3e34debdf16a6d8) style: format webusb build-id fallback line - [`eff673c`](https://github.com/safijari/openpuck/commit/eff673c13e625a9f13017c58d38fc9b130bc4b94) chore: tighten provenance comments - [`726e900`](https://github.com/safijari/openpuck/commit/726e900230a585cf44e8d6935e05352fddc45480) fix: tighten semver tag filters - [`73a748a`](https://github.com/safijari/openpuck/commit/73a748a4e688404b29ec09b051ae7600b2529828) fix: clarify version bootstrap and fallback check - [`88a9095`](https://github.com/safijari/openpuck/commit/88a9095ac0bef2fb7bacf4861cc58deba885756c) fix: harden semver matching for version tags - [`342ea2d`](https://github.com/safijari/openpuck/commit/342ea2dc0e69b9b47249eba786b1f8b604f66a83) fix: validate pushed tags before release build - [`46f2565`](https://github.com/safijari/openpuck/commit/46f2565b9c7dec1db6995e3883229f53e3a3893b) Trigger build on PR approval with PR-specific versioning - [`ce1c485`](https://github.com/safijari/openpuck/commit/ce1c485185b73ef2d70f140f39b6b44d88812fca) Run approved PR builds with PR-aware UF2 version metadata ### 📊 Changes **7 files changed** (+157 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build.yml` (+41 -0) 📝 `.github/workflows/release.yml` (+77 -10) 📝 `OpenPuck/build_info.h` (+8 -4) 📝 `OpenPuck/webusb_config.cpp` (+9 -7) 📝 `docs/BUILD_AND_DEPLOY.md` (+1 -1) 📝 `docs/index.html` (+5 -5) 📝 `gen_version.sh` (+16 -4) </details> ### 📄 Description Approved PRs were not guaranteed to produce UF2 artifacts with PR-identifiable version metadata. This updates CI so approval events trigger the build path and embeds `base version + PR number + commit` into build identity. - **Approved review trigger path** - Added `pull_request_review` (`submitted`) to the build workflow. - Gated job execution so review-triggered runs proceed only when `review.state == approved`. - Kept the existing UF2 generation + artifact upload path in this run type. - **PR-specific version identity** - Added a `Resolve build version` step to compute: - `BASE_VERSION` from latest semver tag (fallback `0.9.1`) - PR builds as: `<base>-pr<PR_NUMBER>+<SHORT_SHA>` - Wired the computed value into `gen_version.sh` via `OPK_BUILD_VERSION`. - Resolved PR number and head SHA correctly for both `pull_request` and `pull_request_review` payload shapes. - **Workflow token scope** - Added explicit workflow permissions: - `contents: read` ```yaml pull_request_review: types: [submitted] jobs: compile: if: github.event_name != 'pull_request_review' || github.event.review.state == 'approved' steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha || github.event.review.pull_request.head.sha || github.sha }} - name: Resolve build version env: PR_NUMBER: ${{ github.event.pull_request.number || github.event.review.pull_request.number || '' }} HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.review.pull_request.head.sha || github.sha }} ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:07:32 +00:00
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#204
No description provided.