Skip to content

Commit

Permalink
ci: fix script and remove "-next" from workflow (biomejs#3467)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Oct 25, 2022
1 parent cc08105 commit d3d4da1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_js_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
if: needs.check.outputs.prerelease == 'true'
run: |
echo "prerelease=true" >> $GITHUB_ENV
node npm/rome/scripts/update-nightly-version.mjs >> $GITHUB_ENV
node npm/js-api/scripts/update-nightly-version.mjs >> $GITHUB_ENV
- name: Set release infos
if: needs.check.outputs.prerelease != 'true'
run: |
Expand Down
27 changes: 27 additions & 0 deletions npm/js-api/scripts/update-nightly-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import * as fs from "node:fs";

const ROME_ROOT = resolve(fileURLToPath(import.meta.url), "../..");
const MANIFEST_PATH = resolve(ROME_ROOT, "package.json");

const rootManifest = JSON.parse(
fs.readFileSync(MANIFEST_PATH).toString("utf-8"),
);

let version = rootManifest["version"];

if (
typeof process.env.GITHUB_SHA !== "string" ||
process.env.GITHUB_SHA === ""
) {
throw new Error("GITHUB_SHA environment variable is undefined");
}

version += `.${process.env.GITHUB_SHA.substring(0, 7)}`;
rootManifest["version"] = version;

const content = JSON.stringify(rootManifest);
fs.writeFileSync(MANIFEST_PATH, content);

console.log(`version=${version}`);
44 changes: 0 additions & 44 deletions npm/js-api/scripts/updateVersionForPrerelease.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion npm/rome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[ci-badge]: https://github.com/rome/tools/actions/workflows/main.yml/badge.svg
[ci-url]: https://github.com/rome/tools/actions/workflows/main.yml
[npm-badge]: https://img.shields.io/npm/v/rome/next?color=brightgreen
[npm-url]: https://www.npmjs.com/package/rome/v/0.7.0-next
[npm-url]: https://www.npmjs.com/package/rome/v/next
[vscode-badge]: https://img.shields.io/visual-studio-marketplace/v/rome.rome?color=brightgreen&label=vscode
[vscode-url]: (https://marketplace.visualstudio.com/items?itemName=rome.rome

Expand Down
3 changes: 0 additions & 3 deletions npm/rome/scripts/update-nightly-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const rootManifest = JSON.parse(
);

let version = rootManifest["version"];
if (!version.includes("-")) {
version += "-next";
}

if (
typeof process.env.GITHUB_SHA !== "string" ||
Expand Down

0 comments on commit d3d4da1

Please sign in to comment.