Skip to content

Add local pending-write recovery management #125

Add local pending-write recovery management

Add local pending-write recovery management #125

Workflow file for this run

name: public CLI gates
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: public-cli-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: npm
- name: Verify public repository boundary and complete history
run: python3 scripts/check-public-repo.py
- name: Install dependencies
run: npm ci
- name: Install Liberation fonts for compose examples
run: sudo apt-get update && sudo apt-get install -y fonts-liberation
- name: Verify source and package
run: |
npm run typecheck
npm run lint
npm test
npm run smoke:mock
npm run pack:dry
- name: Audit locked dependencies
run: npm audit --audit-level=high --package-lock-only
- name: Build npm artifact
run: bash scripts/package-release.sh "${RUNNER_TEMP}/screenrig-cli.tgz"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: github.ref != 'refs/heads/main'
with:
name: screenrig-cli
path: ${{ runner.temp }}/screenrig-cli.tgz
if-no-files-found: error
retention-days: 14
distribute:
if: github.repository == 'screenrig/cli' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
needs: verify
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Tag this commit and stamp the distributing artifact
run: |
version="$(node scripts/calver.mjs tag)"
export SCREENRIG_VERSION="${version}"
bash scripts/package-release.sh "${RUNNER_TEMP}/screenrig-cli.tgz"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: screenrig-cli
path: ${{ runner.temp }}/screenrig-cli.tgz
if-no-files-found: error
retention-days: 14
secrets:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- name: Install checksum-pinned Gitleaks
env:
GITLEAKS_VERSION: 8.30.1
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
run: |
install -d "${RUNNER_TEMP}/screenrig-tools/gitleaks"
archive="${RUNNER_TEMP}/screenrig-tools/gitleaks.tar.gz"
curl --proto '=https' --tlsv1.2 --fail --silent --show-error --location \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
--output "${archive}"
printf '%s %s\n' "${GITLEAKS_SHA256}" "${archive}" | sha256sum --check --status
tar --extract --gzip --file "${archive}" \
--directory "${RUNNER_TEMP}/screenrig-tools/gitleaks" gitleaks
chmod 0755 "${RUNNER_TEMP}/screenrig-tools/gitleaks/gitleaks"
- name: Scan complete Git history for secrets
run: >-
"${RUNNER_TEMP}/screenrig-tools/gitleaks/gitleaks" git
--redact --no-banner --config .gitleaks.toml .
npm-install:
name: npm install (${{ matrix.os }}, Node 20.11.1)
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2022]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "20.11.1"
cache: npm
- run: npm ci
- run: npm run build
- run: npm run check:npm-install