mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-12-16 01:10:30 +02:00
Drop bump-version script (#9188)
This commit is contained in:
parent
ed0c32bb10
commit
32c1611c8e
17
.github/workflows/create-release.yml
vendored
17
.github/workflows/create-release.yml
vendored
@ -41,8 +41,23 @@ jobs:
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
# Ensure we are checked out on the develop branch
|
||||
ref: develop
|
||||
- name: Use Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: Bump version
|
||||
run: node ./scripts/release/bump-version.js "${{ needs.release-pr.outputs.new-version }}"
|
||||
run: |
|
||||
npm version --no-commit-hooks --no-git-tag-version \
|
||||
"${{ needs.release-pr.outputs.new-version }}"
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
- name: Update major version in CDN URLs
|
||||
run: node ./scripts/release/update-cdn-urls.js
|
||||
- name: Update SVGs count milestone
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @fileoverview
|
||||
* Updates the version of this package to the CLI specified version.
|
||||
*/
|
||||
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { getDirnameFromImportMeta } from '../../sdk.mjs';
|
||||
|
||||
const __dirname = getDirnameFromImportMeta(import.meta.url);
|
||||
|
||||
const rootDir = path.resolve(__dirname, '..', '..');
|
||||
const packageJsonFile = path.resolve(rootDir, 'package.json');
|
||||
|
||||
const readManifest = (file) => {
|
||||
const manifestRaw = fs.readFileSync(file, 'utf-8');
|
||||
const manifestJson = JSON.parse(manifestRaw);
|
||||
return manifestJson;
|
||||
};
|
||||
|
||||
const writeManifest = (file, json) => {
|
||||
const manifestRaw = JSON.stringify(json, null, 2) + '\n';
|
||||
fs.writeFileSync(file, manifestRaw);
|
||||
};
|
||||
|
||||
const main = (newVersion) => {
|
||||
try {
|
||||
const manifest = readManifest(packageJsonFile);
|
||||
|
||||
manifest.version = newVersion;
|
||||
|
||||
writeManifest(packageJsonFile, manifest);
|
||||
} catch (error) {
|
||||
console.error(`Failed to bump package version to ${newVersion}:`, error);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
main(process.argv[2]);
|
Loading…
Reference in New Issue
Block a user