Repository navigation
123 lines (116 loc) · 4.31 KB
/
Copy pathci.yml
File metadata and controls
123 lines (116 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22.23.4"
cache: npm
- name: Verify public repository boundary and complete history
run: python3 scripts/check-public-repo.py
- name: Install dependencies
run: npm ci
- name: Verify source and package
run: |
npm run check
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22.23.4"
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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 22.23.4)
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2022]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22.23.4"
cache: npm
- run: npm ci
- run: npm run build
- run: npm run check:npm-install