Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): do not bump version on generate, let CI manage it #199

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/bump_oxlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ jobs:

- uses: ./.github/actions/pnpm

- name: Bump oxlint rules
- name: Generate from latest version
run: |
pnpm update --latest oxlint
pnpm run clone
pnpm run generate # Generate rules from latest oxlint
pnpm run format # run prettier over it
pnpm run test -u # Update test snapshots
npm version ${{ inputs.version }} --no-git-tag-version

- name: Test and update
run: pnpm run test -u # Update test snapshots

- name: Bump oxlint rules
run: npm version ${{ inputs.version }} --no-git-tag-version

- uses: peter-evans/create-pull-request@v7
with:
Expand Down
10 changes: 0 additions & 10 deletions scripts/generate.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { writeFileSync } from 'node:fs';
import { RulesGenerator, RulesGrouping } from './rules-generator.js';
import { ConfigGenerator } from './config-generator.js';
import { traverseRules } from './traverse-rules.js';
import { getLatestVersionFromClonedRepo } from './oxlint-version.js';
import { TARGET_DIRECTORY, VERSION_PREFIX } from './constants.js';
import packageJson from '../package.json' with { type: 'json' };

const { successResultArray, failureResultArray } = await traverseRules();

Expand Down Expand Up @@ -34,11 +32,3 @@ const configGenerator = new ConfigGenerator(oxlintVersion, successResultArray);
generator.setRulesGrouping(RulesGrouping.CATEGORY);
await generator.generateRules();
});
// Update package.json version
writeFileSync(
'../package.json',
JSON.stringify({
...packageJson,
version: oxlintVersion.replace(VERSION_PREFIX, '').split('-')[0],
})
);