-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (64 loc) · 2.4 KB
/
Copy pathpublish.yml
File metadata and controls
82 lines (64 loc) · 2.4 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
name: Publish to npm
on:
push:
tags:
- "v*"
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Verify tag matches package.json version
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
PKG_VERSION=$(node -p "require('./package.json').version")
if [ "${TAG_VERSION}" != "${PKG_VERSION}" ]; then
echo "Tag v${TAG_VERSION} does not match package.json version ${PKG_VERSION}"
exit 1
fi
- name: Install dependencies
run: npm ci
- name: Typecheck package
run: npm run typecheck
- name: Run unit and tarball consumer tests
run: npm test
- name: Validate documentation contract and built links
run: npm run docs:validate
- name: Audit dependencies
run: npm audit --audit-level=low
- name: Preview package contents
run: npm pack --dry-run --json
- name: Validate Redis 7.2 target topology
run: docker compose -f .github/redis/compose.yml config -q
- name: Start Redis 7.2 target topology
run: docker compose -f .github/redis/compose.yml up -d --wait redis-primary redis-replica sentinel-a sentinel-b
- name: Run Redis integration, fault, and Sentinel failover matrix
run: |
docker compose -f .github/redis/compose.yml run --rm \
-e QUEUEBIT_REDIS_URL=redis://redis-primary:6379 \
-e QUEUEBIT_REDIS_SENTINEL_MASTER=queuebit-primary \
-e QUEUEBIT_REDIS_SENTINELS=sentinel-a:26379,sentinel-b:26379 \
-e QUEUEBIT_REDIS_SENTINEL_ALLOW_FAILOVER=1 \
runner
- name: Show Redis target logs after a failure
if: failure()
run: docker compose -f .github/redis/compose.yml logs --no-color
- name: Clean up Redis target topology
if: always()
run: docker compose -f .github/redis/compose.yml down --volumes --remove-orphans
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}