Skip to content

Commit d26915d

Browse files
committed
chore: setup v1 support mode
1 parent 3555d52 commit d26915d

File tree

14 files changed

+308
-351
lines changed

14 files changed

+308
-351
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"fixed": [["@redocly/cli", "@redocly/openapi-core", "@redocly/respect-core"]],
66
"linked": [],
77
"access": "public",
8-
"baseBranch": "main",
8+
"baseBranch": "v1",
99
"updateInternalDependencies": "patch",
1010
"ignore": []
1111
}

.github/workflows/performance.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Performance Benchmark
33
on:
44
pull_request:
55
branches:
6-
- main
6+
- v1
77

88
env:
99
CI: true
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Dependencies
2222
run: npm ci
2323
- name: Install External
24-
run: npm i -g hyperfine @redocly/cli@latest
24+
run: npm i -g hyperfine @redocly/cli@v1
2525
- name: Prepare
2626
run: |
2727
jq '.bin = {"redocly-next":"bin/cli.js"} | .name = "@redocly/cli-next"' packages/cli/package.json > __tmp__.json
@@ -42,8 +42,8 @@ jobs:
4242
comment_tag: latest-vs-next-comparison
4343

4444
historical-versions:
45-
# Run only on release branch (changeset-release/main):
46-
if: github.head_ref == 'changeset-release/main'
45+
# Run only on release branch (changeset-release/v1):
46+
if: github.head_ref == 'changeset-release/v1'
4747
runs-on: ubuntu-latest
4848
steps:
4949
- uses: actions/checkout@v3

.github/workflows/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
branches:
6-
- main
6+
- v1
77

88
concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
@@ -101,7 +101,7 @@ jobs:
101101
ghcr.io/redocly/cli
102102
tags: |
103103
${{ steps.get_version.outputs.value }}
104-
latest
104+
v1
105105
106106
- name: Set up QEMU
107107
uses: docker/setup-qemu-action@v1
@@ -144,7 +144,7 @@ jobs:
144144
- uses: actions/checkout@v3
145145
- uses: actions/setup-node@v3
146146
- name: Install CLI from npm
147-
run: npm i -g @redocly/cli@latest
147+
run: npm i -g @redocly/cli@v1
148148
- name: Test version from NPM
149149
continue-on-error: true
150150
run: |
@@ -159,7 +159,7 @@ jobs:
159159
redocly bundle https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml -o bundled.json
160160
redocly build-docs https://raw.githubusercontent.com/Rebilly/api-definitions/main/openapi/openapi.yaml
161161
- name: Pull docker image
162-
run: docker pull redocly/cli:latest
162+
run: docker pull redocly/cli:v1
163163
- name: Test docker image
164164
continue-on-error: true
165165
run: |

.github/workflows/require-changeset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
require-changeset-or-label:
8-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no changeset needed') && github.head_ref != 'changeset-release/main' }}
8+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no changeset needed') && github.head_ref != 'changeset-release/v1' }}
99
runs-on: ubuntu-latest
1010
env:
1111
CI: true
@@ -20,4 +20,4 @@ jobs:
2020
cache: 'npm'
2121
- run: npm ci
2222
- name: Check for changeset
23-
run: npx changeset status --since origin/main
23+
run: npx changeset status --since origin/v1

.github/workflows/snapshot-pr.yaml

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

.github/workflows/snapshot-release.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ name: Snapshot Release
22

33
on:
44
pull_request:
5-
types: [closed]
6-
branches:
7-
- snapshot
5+
types: [labeled]
86

97
jobs:
108
release-snapshot:
11-
if: github.event.pull_request.merged == true
9+
if: github.event.label.name == 'snapshot'
1210
runs-on: ubuntu-latest
1311
permissions:
1412
contents: write
1513
pull-requests: write
14+
1615
steps:
1716
- uses: actions/checkout@v4
1817

@@ -41,13 +40,15 @@ jobs:
4140
jq ".dependencies[\"@redocly/respect-core\"] = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json
4241
4342
# Add comment with installation instructions
44-
COMMENT="📦 A new experimental version **v$VERSION** of Redocly CLI has been published for testing.
43+
COMMENT="📦 A new experimental 🧪 version **v$VERSION** of Redocly CLI has been published for testing.
4544
4645
Install with NPM:
4746
\`\`\`bash
4847
npm install @redocly/cli@$VERSION
4948
# or
5049
npm install @redocly/openapi-core@$VERSION
50+
# or
51+
npm install @redocly/respect-core@$VERSION
5152
\`\`\`
5253
5354
⚠️ Note: This is a development build and may contain unstable features."

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, synchronize, reopened]
66
push:
77
branches:
8-
- main
8+
- v1
99

1010
env:
1111
CI: true

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Before submitting your contribution though, please make sure to take a moment an
2727

2828
Before submitting a pull request, please make sure the following is done:
2929

30-
1. Fork the repository and create your branch from `main`.
30+
1. Fork the repository and create your branch from `v1`.
3131
1. Run `npm install` in the repository root.
3232
1. If you’ve fixed a bug or added code that should be tested, don't forget to add [tests](#tests)!
3333
1. Ensure the test suite passes (see the [Tests section](#tests) for more details).
@@ -251,22 +251,22 @@ We use [Changesets](https://github.com/changesets/changesets) flow.
251251
After merging a PR with a changeset, the release PR is automatically created.
252252

253253
If the pipelines are not starting, close and reopen the PR.
254-
Merging that PR triggers the release process.
254+
Merging that PR triggers the release process under the `v1` label.
255255

256256
### Revert a release
257257

258258
There's no possibility to revert a release itself.
259259
However, you can release a new version with a problematic commit reverted.
260-
Create a new branch from **main**, then find the hash of the commit you want to revert and run `git revert <commit-hash>`.
260+
Create a new branch from **v1**, then find the hash of the commit you want to revert and run `git revert <commit-hash>`.
261261
Create a patch-level changeset for the revert and open a PR with it.
262262
Merge the PR and cut a release according to the [Release flow](#release-flow).
263263

264264
### Snapshot release
265265

266266
To release an experimental version to the **NPM** registry, follow these steps:
267267

268-
1. Create a new PR to **main**.
269-
2. Add the `snapshot` label to the PR. This creates a new PR with to the `snapshot` branch (which is a copy of the `main` branch).
270-
3. Merging the second PR triggers release to the **NPM** registry under the `snapshot` tag.
268+
1. Create a new PR to **v1**.
269+
2. Add the `snapshot` label to the PR.
270+
This triggers a release of the current branch changes to the **NPM** registry under the `snapshot` tag.
271271

272-
The released version can be installed with `npm install @redocly/cli@snapshot`.
272+
The released version can be installed with `npm install @redocly/cli@snapshot`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Supports OpenAPI 3.1, 3.0 and OpenAPI 2.0 (legacy Swagger), AsyncAPI 3.0 and 2.6
1616
### Node
1717

1818
```sh
19-
npx @redocly/cli@latest lint path-to-root-file.yaml
19+
npx @redocly/cli@v1 lint path-to-root-file.yaml
2020
```
2121

2222
Alternatively, install it globally with `npm`:

__tests__/respect/free-apis/free-apis.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'path';
22
import { getParams, getCommandOutput } from '../utils';
33

4-
test('free apis test case', () => {
4+
test.skip('free apis test case', () => {
55
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');
66
const fixturesPath = join(__dirname, 'free.arazzo.yaml');
77
const args = getParams(indexEntryPoint, ['respect', fixturesPath]);

0 commit comments

Comments
 (0)