Repository navigation
47 lines (43 loc) · 1.67 KB
/
Copy pathci.yml
File metadata and controls
47 lines (43 loc) · 1.67 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
name: Full validation
on:
workflow_call:
inputs:
pack:
type: boolean
default: false
outputs:
package-sha256:
value: ${{ jobs.ci.outputs.package-sha256 }}
workflow_dispatch:
permissions:
contents: read
jobs:
ci:
uses: WireCatLabs/cli-base/.github/workflows/node-ci.yml@34a442be7352a59598b0bdcccc03186ae1f6a728 # v0.85.1
with:
pack: ${{ inputs.pack || false }}
checks: |
pnpm docs:check
version:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# A warning, never a failure: bin/release takes the next free version itself.
- name: version above main and npm
continue-on-error: true
run: |
pr=$(node -p 'require("./package.json").version')
git fetch -q --depth=1 origin main
main=$(git show FETCH_HEAD:package.json | node -p 'JSON.parse(require("fs").readFileSync(0)).version')
[ "$pr" != "$main" ] || exit 0
name=$(node -p 'require("./package.json").name')
latest=$(npm view "$name" version 2>/dev/null || true)
floor=$(printf '%s\n%s\n' "$main" "$latest" | sort -V | tail -1)
versions=$(npm view "$name" versions --json 2>/dev/null || true)
next=$(npx -y -p @wirecat/cli-base@0.19.0 cli-dev next-version "$pr" "$floor" "$versions")
[ "$next" != "$pr" ] || exit 0
echo "::warning file=package.json::version $pr is not above both main ($main) and npm's latest ($latest)" \
"— bin/release will publish it as $next"