- notify-ci-failure.yml lists its workflows by name. `workflows: ['*']` is not a wildcard to workflow_run: it matched nothing, so `main` was red from 2026-09-23 with no one told. - cargo audit runs a prebuilt cargo-audit (taiki-e/install-action, pinned by commit) with `--deny warnings`, replacing rustsec/audit-check@v2 - Node 20, a check-run write token, and on a pull request a failure only for "critical", which is how September's advisories passed every PR. .cargo/audit.toml's contract (a new informational advisory fails CI) is now what runs. - security-scan.yml: both audits daily against `main`, so an advisory against something already merged is reported the day it is published, not at the next PR. - cargo deny (licences, sources, bans) with deny.toml: the licence allowlist makes "every bundled licence is GPL-3.0-compatible" a test. The workspace declares `publish = false`, which it never had - and without which cargo-deny judged the app crates as published ones. - CodeQL analyses rust and actions as well as javascript-typescript. The comment saying CodeQL had no Rust support stopped being true in 2025. - ci-node.yml: Pages and id-token write move from the workflow to the one job that needs them (Sonar S8233); the audit installs with --ignore-scripts (S6505); a new `tauri lockstep` job fails when a Tauri crate and its npm package drift apart on Cargo.lock and package-lock.json. - release.yml: build (read-only token, no persisted credentials) and publish (attest + draft) are separate jobs; the tag must match all five version fields; SHA256SUMS.txt is LF, which `sha256sum -c` elsewhere needs; actions/attest-build-provenance attests the .exe and .msi; softprops/action-gh-release is pinned by commit; `workflow_dispatch` with `dry_run` builds any ref without attesting or drafting. - ci-integration.yml also runs for the CLI, exec, audit, release metadata, errors, store, index, Cargo.lock and rust-toolchain.toml - every one of which its end-to-end steps run through. - dependabot.yml: cooldowns, a group per ecosystem for Tauri packages and for actions and pip, TypeScript held below 6.1 (typescript-eslint's peer range), and the rust-toolchain ecosystem. A multi-ecosystem group would put both Tauri halves in one PR, but what it does to dependencies outside its patterns is undocumented; the lockstep job covers the gap instead. - Sonar: NOSONAR with reasons on the dev scripts' argv and PATH lookups; bundle-cli.mjs no longer claims to run from beforeBuildCommand. The dev CSP moves out of index.html into a Vite plugin that reads devCsp from tauri.conf.json, so a release build carries one policy, the strict one (S7039); checked in the dev server, where React Refresh's preamble still runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
193 lines
7.8 KiB
YAML
193 lines
7.8 KiB
YAML
# Project-local: the ops repo has no reusable Tauri/build workflow (docs/RELEASE-CI.md §1).
|
|
#
|
|
# Builds the NSIS .exe and .msi, attests where they were built, publishes SHA256SUMS.txt and leaves
|
|
# a DRAFT release. Publishing is a separate, human-directed step (RELEASE-CI.md §3.4), and
|
|
# announce-release.yml fires on `release: published`.
|
|
#
|
|
# **Two jobs, so the token that can write releases never runs the build.** Building executes
|
|
# third-party code — every crate's build script, every npm package's — and gets a read-only token
|
|
# with no credentials left in the checkout. The publish job only attests and uploads what the build
|
|
# produced.
|
|
#
|
|
# `workflow_dispatch` with `dry_run` builds and checksums any ref — a branch before it merges —
|
|
# without attesting or drafting anything: the release recipe is tested before a tag depends on it.
|
|
#
|
|
# PipDock does not update itself, so there is no signing key and no `latest.json` here. Users get
|
|
# new versions from the GitHub Releases page; the checksums and the attestation are what they
|
|
# verify against (docs/SECURITY.md §5).
|
|
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: Tag to build (for re-runs). Empty builds the selected ref.
|
|
required: false
|
|
type: string
|
|
dry_run:
|
|
description: Build and checksum only — no attestation, no draft release.
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: release-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
name: Build · checksum
|
|
runs-on: windows-latest
|
|
timeout-minutes: 90
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
tag: ${{ steps.version.outputs.tag }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ inputs.tag || github.ref }}
|
|
persist-credentials: false
|
|
|
|
# The version lives in five places and they move together (CLAUDE.md), and a tag names the
|
|
# one they must all carry. A tag pushed before the bump commit, or a bump that missed one
|
|
# file, would otherwise build an installer whose About states another version.
|
|
- name: The tag and all five versions agree
|
|
id: version
|
|
shell: pwsh
|
|
env:
|
|
REF: ${{ inputs.tag || github.ref_name }}
|
|
DRY_RUN: ${{ inputs.dry_run || false }}
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
$found = [ordered]@{}
|
|
$found['Cargo.toml'] = (Select-String -Path Cargo.toml -Pattern '^version = "([^"]+)"' |
|
|
Select-Object -First 1).Matches[0].Groups[1].Value
|
|
$lock = Get-Content Cargo.lock -Raw
|
|
if ($lock -notmatch '(?m)^name = "pipdock-core"\r?\nversion = "([^"]+)"') { throw 'pipdock-core is not in Cargo.lock' }
|
|
$found['Cargo.lock'] = $Matches[1]
|
|
$found['package.json'] = (Get-Content package.json -Raw | ConvertFrom-Json).version
|
|
# -AsHashtable: package-lock.json has a property named "", which plain ConvertFrom-Json refuses.
|
|
$found['package-lock.json'] = (Get-Content package-lock.json -Raw | ConvertFrom-Json -AsHashtable)['version']
|
|
$found['tauri.conf.json'] = (Get-Content src-tauri/tauri.conf.json -Raw | ConvertFrom-Json).version
|
|
$found.GetEnumerator() | ForEach-Object { Write-Host ("{0,-18} {1}" -f $_.Key, $_.Value) }
|
|
$versions = @($found.Values | Sort-Object -Unique)
|
|
if ($versions.Count -ne 1) { throw "the five versions disagree: $($versions -join ', ')" }
|
|
$v = $versions[0]
|
|
if ($env:REF -match '^v\d') {
|
|
if ($env:REF -ne "v$v") { throw "tag $env:REF does not match version $v" }
|
|
} elseif ($env:DRY_RUN -ne 'true') {
|
|
throw "$env:REF is not a version tag; only a dry run builds a branch"
|
|
}
|
|
"tag=v$v" >> $env:GITHUB_OUTPUT
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '24'
|
|
cache: npm
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}
|
|
restore-keys: ${{ runner.os }}-cargo-release-
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm ci
|
|
|
|
# One script owns the recipe (`package.json` → `bundle`), so the workflow cannot drift
|
|
# from what a developer runs locally. It stages the CLI sidecar, then bundles with the
|
|
# overlay config that declares it.
|
|
#
|
|
# **The overlay exists because `tauri-build` validates `externalBin` at build-script time.**
|
|
# Declaring the sidecar in `tauri.conf.json` made plain `cargo clippy` and `cargo test` fail
|
|
# in a fresh clone with "resource path ... doesn't exist" — a bundling concern leaking into
|
|
# every compile. `--config` merges it in only when bundling.
|
|
- name: Build and bundle
|
|
run: npm run bundle
|
|
|
|
- name: Collect artifacts
|
|
shell: pwsh
|
|
run: |
|
|
$out = "release-artifacts"
|
|
New-Item -ItemType Directory -Force $out | Out-Null
|
|
Get-ChildItem -Recurse target\release\bundle -Include *.exe, *.msi |
|
|
ForEach-Object { Copy-Item $_.FullName $out }
|
|
Get-ChildItem $out
|
|
|
|
- name: Checksums
|
|
shell: pwsh
|
|
run: |
|
|
# SmartScreen warns on first run because the binaries are not EV-code-signed, so the
|
|
# README tells users to verify these instead (docs/SECURITY.md §5).
|
|
#
|
|
# LF line endings, written byte for byte: `Set-Content` wrote CRLF, and `sha256sum -c`
|
|
# on any other platform reads the CR as part of the file name and reports it missing.
|
|
$lines = Get-ChildItem release-artifacts -File |
|
|
Where-Object { $_.Name -ne 'SHA256SUMS.txt' } |
|
|
Sort-Object Name |
|
|
ForEach-Object { "$((Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower()) $($_.Name)" }
|
|
[IO.File]::WriteAllText(
|
|
(Join-Path $PWD 'release-artifacts\SHA256SUMS.txt'),
|
|
(($lines -join "`n") + "`n"),
|
|
[Text.Encoding]::ASCII)
|
|
Get-Content release-artifacts\SHA256SUMS.txt
|
|
|
|
- name: Upload the build
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: release-artifacts
|
|
path: release-artifacts/*
|
|
if-no-files-found: error
|
|
|
|
publish:
|
|
name: Attest · draft
|
|
needs: build
|
|
if: ${{ !inputs.dry_run }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: write # the draft release and its assets
|
|
id-token: write # Sigstore, for the attestation
|
|
attestations: write
|
|
steps:
|
|
- name: Download the build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: release-artifacts
|
|
path: release-artifacts
|
|
|
|
# Build provenance for the two installers: `gh attestation verify <file> --repo
|
|
# poli0981/pipdock` proves an installer came from this workflow, at this commit — which a
|
|
# checksum published beside the file cannot, since whoever could replace one could replace
|
|
# both.
|
|
- name: Attest provenance
|
|
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
|
with:
|
|
subject-path: |
|
|
release-artifacts/*.exe
|
|
release-artifacts/*.msi
|
|
|
|
- name: Draft GitHub release
|
|
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
|
|
with:
|
|
tag_name: ${{ needs.build.outputs.tag }}
|
|
draft: true # reviewed, then published; publishing triggers the announcement
|
|
generate_release_notes: true
|
|
files: release-artifacts/*
|