1
0
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:
Álvaro Mondéjar 2023-08-01 12:06:45 -06:00 committed by GitHub
parent ed0c32bb10
commit 32c1611c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 40 deletions

View File

@ -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

View File

@ -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]);