Skip to content

Commit f1ab1fd

Browse files
committed
feat(release): add beta channel and docs automation
1 parent 9550a3a commit f1ab1fd

11 files changed

Lines changed: 6275 additions & 6768 deletions

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
- beta
9+
push:
10+
branches:
11+
- master
12+
- main
13+
- beta
14+
workflow_dispatch:
15+
16+
jobs:
17+
validate:
18+
name: Validate on Node ${{ matrix.node-version }}
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
node-version: [22, 24]
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: npm
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Run tests
42+
run: npm test
43+
44+
- name: Smoke-load release config
45+
run: npm run test:config
46+
47+
- name: Check docs index
48+
run: npm run docs:index:check
49+
50+
semantic-release-dry-run:
51+
name: semantic-release dry run
52+
runs-on: ubuntu-latest
53+
needs: validate
54+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
55+
permissions:
56+
contents: read
57+
issues: write
58+
pull-requests: write
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0
64+
65+
- name: Setup Node.js
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version: 24
69+
cache: npm
70+
71+
- name: Install dependencies
72+
run: npm ci
73+
74+
- name: Validate release tokens are present
75+
run: |
76+
test -n "$GITHUB_TOKEN"
77+
test -n "$NPM_TOKEN"
78+
79+
- name: Run semantic-release in dry-run mode
80+
env:
81+
CI: true
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
84+
run: npm run release:dry-run

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ master, main ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ master, main ]
2020
schedule:
2121
- cron: '18 1 * * 0'
2222

@@ -39,11 +39,11 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v4
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v3
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v3
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,30 @@ on:
44
push:
55
branches:
66
- master
7+
- main
8+
- beta
79

810
jobs:
911
publish:
10-
name: Publish to Github & NPM or Github Package Registry
12+
name: Publish to GitHub and npm
1113
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
issues: write
17+
pull-requests: write
1218
steps:
13-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
1422
- uses: actions/setup-node@v4
1523
with:
16-
node-version: 18
17-
- env:
18-
CI: true
24+
node-version: 24
25+
cache: npm
26+
- name: Install dependencies
1927
run: npm ci
20-
- if: success()
28+
- name: Publish release
2129
env:
2230
CI: true
23-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2431
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2532
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26-
run: npx semantic-release
33+
run: npm run semantic-release

.github/workflows/test-release.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Docs Index
2+
3+
Repository documentation kept in sync by `docs-index-keeper`.
4+
5+
| Doc | Purpose |
6+
| --- | --- |
7+
| [release-channels.md](./release-channels.md) | Stable and beta release channel behavior for this repository |
8+
| [release-channels](release-channels.md) | Release Channels |

docs/release-channels.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Release Channels
2+
3+
This repository uses a repo-only semantic-release config to keep package consumers on the shared preset while giving the repository two release channels:
4+
5+
- `master` and `main` publish stable releases on the default `latest` channel during the branch migration window
6+
- `beta` publishes prereleases with the `beta` dist-tag and `-beta.N` versions
7+
8+
The repo automation uses `release.repo.config.js` so the published shareable config in `release.config.js` does not force prerelease branches on downstream consumers.

0 commit comments

Comments
 (0)