Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/regenerate-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ name: regenerate-native
# regenerates for that same reason or whenever sources/libClangSharp changes. Both can also be
# forced via workflow_dispatch. See the "Regenerating native binaries" section in README.md.
#
# The jobs upload the resulting .nupkg files as build artifacts and sign them via the
# separate sign-nuget leg; publishing to NuGet is manual.
# The jobs upload the resulting .nupkg files as build artifacts. Push runs sign them
# automatically; workflow_dispatch can opt in to signing. Publishing to NuGet is manual.

on:
push:
Expand All @@ -25,6 +25,10 @@ on:
description: "Force regenerating the libClangSharp runtime packages"
type: boolean
default: false
sign:
description: "Sign the generated native packages"
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -168,12 +172,11 @@ jobs:

sign-nuget:
needs: [ libclang, libclangsharp-pack ]
# Sign on pushes to main whenever the legs that actually ran succeeded. A leg that
# was version-gated out is 'skipped' (not a failure), so a libClangSharp-only
# regeneration still gets signed; a real failure or cancellation blocks signing.
# Sign pushes automatically and allow workflow_dispatch to opt in. A leg that was
# version-gated out is 'skipped' (not a failure); failures block signing.
if: >-
${{ github.event_name == 'push'
&& !cancelled()
${{ !cancelled()
&& (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.sign))
&& needs.libclang.result != 'failure'
&& needs.libclangsharp-pack.result != 'failure'
&& (needs.libclang.result == 'success' || needs.libclangsharp-pack.result == 'success') }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ The jobs run when:
* **libclang** — the tracked LLVM major/minor version changes, or the workflow is dispatched manually with the `libclang` input set.
* **libClangSharp** — the same LLVM version change, or anything under `sources/libClangSharp/` changes, or the workflow is dispatched manually with the `libclangsharp` input set.

Before anything is downloaded, the workflow verifies the `packages/**/*.nuspec` and `packages/**/runtime.json` versions match the tracked LLVM version (libclang exactly; libClangSharp as `<llvm-version>.<revision>`), so a version bump that forgot to update a package fails fast. Each job uploads the resulting `.nupkg` files as build artifacts and signs them; publishing them to NuGet.org is a manual step. To move to a new LLVM release, bump the version in `CMakeLists.txt` alongside the `<version>` in the affected `packages/**/*.nuspec` files (and the versions in `packages/**/runtime.json` and this README); pushing that change regenerates the packages.
Before anything is downloaded, the workflow verifies the `packages/**/*.nuspec` and `packages/**/runtime.json` versions match the tracked LLVM version (libclang exactly; libClangSharp as `<llvm-version>.<revision>`), so a version bump that forgot to update a package fails fast. Each job uploads the resulting `.nupkg` files as build artifacts. Push-triggered runs sign them automatically; manually dispatched runs can opt in to signing. Publishing them to NuGet.org is a manual step. To move to a new LLVM release, bump the version in `CMakeLists.txt` alongside the `<version>` in the affected `packages/**/*.nuspec` files (and the versions in `packages/**/runtime.json` and this README); pushing that change regenerates the packages.

### Generating Bindings

Expand Down
Loading