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
165 changes: 0 additions & 165 deletions .config/cliff.toml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/sync-node-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Copy the cpp-linter-js version from bindings/node/Cargo.toml into
# bindings/node/package.json and the version checks in bindings/node/index.js.
# release-plz only updates Cargo manifests, so the release PR needs this step.
set -euo pipefail
cd "$(dirname "$0")/.."

new=$(cargo metadata --format-version 1 --no-deps \
| jq -r '.packages[] | select(.name == "cpp-linter-js") | .version')
cd bindings/node
old=$(node -p "require('./package.json').version")
if [[ "$old" == "$new" ]]; then
echo "package.json already has version $new"
exit 0
fi
npm pkg set version="$new"
# index.js is generated by `napi build`; only its version checks change.
sed -i "s/${old//./\\.}/${new}/g" index.js
echo "Synced bindings/node from $old to $new"
53 changes: 10 additions & 43 deletions .github/workflows/binary-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@ name: Binary builds

on:
push:
branches: [main]
paths:
- cpp-linter/src/**
- cpp-linter/Cargo.toml
- clang-tools-manager/src/**
- clang-tools-manager/Cargo.toml
- Cargo.toml
- Cargo.lock
tags:
- cpp-linter/v*
- clang-tools-manager/v*
pull_request:
branches: [main]
paths:
- cpp-linter/src/**
- cpp-linter/Cargo.toml
- clang-tools-manager/src/**
- clang-tools-manager/Cargo.toml
- Cargo.toml
- Cargo.lock
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
Expand All @@ -36,6 +23,10 @@ concurrency:
jobs:
seed-build-script:
name: Pre-seed static binaries' versions
# On PRs, only the release PR is built, once it is marked ready for review.
if: >-
github.event_name != 'pull_request'
|| (startsWith(github.head_ref, 'release-plz-') && !github.event.pull_request.draft)
uses: $/.github/workflows/pre-seed-versions.yml

create-assets:
Expand Down Expand Up @@ -183,49 +174,25 @@ jobs:
path: dist/clang-tools-${{ matrix.target }}*
if-no-files-found: error

publish:
upload:
if: startswith(github.ref, 'refs/tags/cpp-linter/v') || startswith(github.ref, 'refs/tags/clang-tools-manager/v')
runs-on: ubuntu-latest
needs: [create-assets, seed-build-script]
needs: [create-assets]
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install Rust
run: rustup update stable --no-self-update
- name: Download built assets
uses: actions/download-artifact@v8
with:
pattern: ${{ startsWith(github.ref_name, 'cpp-linter') && 'cpp-linter' || 'clang-tools' }}-*
path: dist
merge-multiple: true
- name: Create a Github Release
- name: Upload assets to the GitHub release
env:
BIN_NAME: ${{ startsWith(github.ref_name, 'cpp-linter') && 'cpp-linter' || 'clang-tools' }}
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
GIT_REF: ${{ github.ref_name }}
run: |
files=$(ls dist/${BIN_NAME}*)
gh release upload "${GIT_REF}" ${files}
- name: Restore build script seed
if: startsWith(github.ref_name, 'clang-tools-manager/v')
uses: actions/download-artifact@v8
with:
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Establish provenance
id: auth
uses: rust-lang/crates-io-auth-action@3268eb413133e2960fa4ae0e963ca76380c54cd9 # v1.0.6
- name: Publish package
env:
PKG_NAME: ${{ startsWith(github.ref_name, 'cpp-linter') && 'cpp-linter' || 'clang-tools-manager' }}
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
# `--allow-dirty` is required for clang-tools-manager
# because the static-binaries-index.json file is flagged as "not checked in",
# but docs.rs build requires the static-binaries-index.json file present to
# avoid clang-tools-manager/build.rs using network access.
PUB_ARG: ${{ startsWith(github.ref_name, 'clang-tools-manager/v') && '--allow-dirty' || '' }}
run: cargo publish -p ${PKG_NAME} ${PUB_ARG}
Loading