Add release workflow for Linux and Windows#49
Conversation
5656hcx
left a comment
There was a problem hiding this comment.
Looks good, if already tested we can merge and see how it works for future releases.
One thing is this action will not update sub versions of individual drivers like QCOM_ADB_VERSION. Can we handle it through GitHub actions? Or do we want to keep individual version number for each drivers in the future?
|
Thanks @5656hcx! Good point on the individual driver sub-versions. I have added optional inputs for each driver sub-version ( |
This PR adds a GitHub Actions release workflow and a Windows build script to automate the release process for both Linux and Windows drivers.
Changes
.github/workflows/release.ymlA
workflow_dispatchworkflow triggered manually from the GitHub Actions UI. It accepts:linux_version1.0.6.5windows_version1.00.94.6filter_version1.0.1.6net_version5.0.1.2wdfserial_version1.0.3.7qdss_version1.0.4.2adb_version1.0.1.7base_branchmain(default)release_notesdraftfalse(default)Either or both of
linux_version/windows_versioncan be supplied in a single run.Linux job (fully automated on GitHub-hosted runner):
release-lnx-{version}src/linux/version.hwith the new version.debpackage viasrc/linux/build-deb.sh.deb+RELEASES.md+README.mdinto a ziprelease-lnx-v{version}If the build fails:
Windows job (branch/tag/release automation only — build is local):
release-win-{version}src/windows/qcversion.h:QCOM_USB_DRIVERS_PRODUCT_VERSIONis always updated towindows_versionrelease-win-v{version}Individual driver sub-version inputs (all optional):
filter_versionQCOM_FILTER_VERSION,QCOM_FILTER_FILE_VERSIONnet_versionQCOM_NET_VERSION,QCOM_NET_FILE_VERSIONwdfserial_versionQCOM_WDFSERIAL_VERSION,QCOM_WDFSERIAL_FILE_VERSIONqdss_versionQCOM_QDSS_VERSION,QCOM_QDSS_FILE_VERSIONadb_versionQCOM_ADB_VERSIONbuild/build_drivers.ps1PowerShell build script for Windows drivers (requires Visual Studio + WDK on the build machine):
vswhereand WDK via registrysrc/windows/qcversion.hinf2catbuild/target/Drivers/Windows10/Release naming convention
release-lnx-{version}release-lnx-v{version}release-win-{version}release-win-v{version}Access control — only maintainers can trigger a release
The workflow enforces two independent gates:
Gate 1 — Explicit permission check (in-workflow)
The first step of the
validatejob calls the GitHub API to verify the triggering actor haswrite,maintain, oradminpermission on the repository. If not, the workflow fails immediately with a clear error message before any branch or tag is created.Gate 2 — Environment protection (
environment: release)Both release jobs use
environment: release. When configured in Settings → Environments with required reviewers, the workflow pauses for explicit human approval even after the permission check passes.To configure the environment (repo admin, one-time setup):
releaseIf the
releaseenvironment does not exist, Gate 1 (permission check) still enforces maintainer-only access.How to trigger a release
For Linux-only release:
linux_version:1.0.6.7windows_version: (leave empty)For Windows-only release with sub-version bumps:
linux_version: (leave empty)windows_version:1.00.94.7adb_version:1.0.1.7filter_version:1.0.1.6Example: Linux release
1.0.6.5Triggered via workflow dispatch with
linux_version=1.0.6.5:release-lnx-1.0.6.5and updatedsrc/linux/version.hqud_1.0.6.5_all.debviabuild-deb.shon a GitHub-hosted Ubuntu runnerrelease-lnx-v1.0.6.5qud_1.0.6.5_all.zipResult: https://github.com/qualcomm/qcom-usb-kernel-drivers/releases/tag/release-lnx-v1.0.6.5
Example: Windows release
1.00.94.6Step 1 — Trigger workflow with
windows_version=1.00.94.6:release-win-1.00.94.6and updatedsrc/windows/qcversion.hrelease-win-v1.00.94.6Step 2 — Build locally on a Windows machine with Visual Studio 2019 + WDK:
Step 3 — Upload and publish:
Result: https://github.com/qualcomm/qcom-usb-kernel-drivers/releases/tag/release-win-v1.00.94.6
Notes on Windows driver signing
The build script produces test-signed drivers (WDK auto-generates a
WDKTestCertper machine). For production distribution, drivers must be submitted to Microsoft Hardware Dev Center for attestation signing using an EV code-signing certificate. Thebuild/build_drivers.ps1script includes aSign-Filehelper that can be extended to support production signing.Test results
The complete workflow was tested on fork
hangzqcom/qcom-usb-kernel-driversafter all changes were applied.Linux release
1.0.6.6— workflow runPublished release: https://github.com/hangzqcom/qcom-usb-kernel-drivers/releases/tag/release-lnx-v1.0.6.6
Artifact:
qud_1.0.6.6_all.zipWindows release
1.00.94.7with sub-version bumps — workflow runTriggered with
windows_version=1.00.94.7,filter_version=1.0.1.6,adb_version=1.0.1.7:QCOM_USB_DRIVERS_PRODUCT_VERSIONQCOM_FILTER_VERSIONQCOM_ADB_VERSIONQCOM_NET_VERSIONQCOM_WDFSERIAL_VERSIONQCOM_QDSS_VERSIONPublished draft release: https://github.com/hangzqcom/qcom-usb-kernel-drivers/releases/tag/release-win-v1.00.94.7
Windows release
1.00.94.6— tested previouslybuild_drivers.ps1)Published release: https://github.com/hangzqcom/qcom-usb-kernel-drivers/releases/tag/release-win-v1.00.94.6
Security
All
${{ inputs.* }}and${{ steps.*.outputs.* }}interpolations have been moved out ofrun:blocks into per-stepenv:sections to prevent shell injection (Semgreprun-shell-injectionrule).