mirror of
https://github.com/Dasemu/X-GeoBlock.git
synced 2026-11-27 07:46:14 +00:00
fix: install dependencies before release checks
This commit is contained in:
1 parent
1a1445ba13
commit
6675d27c42
4 files changed
+56
-6
No files matched your search
@@ -0,0 +1,36 @@
|
|||||||
|
name: Checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [development]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, development]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: checks-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run checks
|
||||||
|
run: npm run check
|
||||||
|
|
||||||
|
- name: Build browser packages
|
||||||
|
run: npm run build
|
||||||
@@ -22,6 +22,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run checks
|
||||||
|
run: npm run check
|
||||||
|
|
||||||
- name: Detect release type
|
- name: Detect release type
|
||||||
id: release_type
|
id: release_type
|
||||||
env:
|
env:
|
||||||
@@ -47,14 +59,11 @@ jobs:
|
|||||||
git checkout main
|
git checkout main
|
||||||
git pull --ff-only origin main
|
git pull --ff-only origin main
|
||||||
version="$(node scripts/bump-version.mjs "$RELEASE_KIND")"
|
version="$(node scripts/bump-version.mjs "$RELEASE_KIND")"
|
||||||
git add manifest.json package.json
|
git add manifest.json package.json package-lock.json
|
||||||
git commit -m "chore(release): v${version} [skip release]"
|
git commit -m "chore(release): v${version} [skip release]"
|
||||||
git push origin main
|
git push origin main
|
||||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Run checks
|
|
||||||
run: npm run check
|
|
||||||
|
|
||||||
- name: Build browser packages
|
- name: Build browser packages
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "x-geoblock",
|
"name": "x-geoblock",
|
||||||
"version": "1.0.1",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "x-geoblock",
|
"name": "x-geoblock",
|
||||||
"version": "1.0.1",
|
"version": "1.1.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"linkedom": "^0.18.12"
|
"linkedom": "^0.18.12"
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ if (!new Set(["patch", "minor"]).has(kind)) {
|
|||||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
const manifestPath = resolve(root, "manifest.json");
|
const manifestPath = resolve(root, "manifest.json");
|
||||||
const packagePath = resolve(root, "package.json");
|
const packagePath = resolve(root, "package.json");
|
||||||
|
const packageLockPath = resolve(root, "package-lock.json");
|
||||||
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
||||||
const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
|
const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
|
||||||
|
const packageLock = JSON.parse(readFileSync(packageLockPath, "utf8"));
|
||||||
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(manifest.version);
|
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(manifest.version);
|
||||||
if (!match) throw new Error(`Unsupported version: ${manifest.version}`);
|
if (!match) throw new Error(`Unsupported version: ${manifest.version}`);
|
||||||
|
|
||||||
@@ -26,6 +28,9 @@ if (kind === "minor") {
|
|||||||
const version = `${major}.${minor}.${patch}`;
|
const version = `${major}.${minor}.${patch}`;
|
||||||
manifest.version = version;
|
manifest.version = version;
|
||||||
packageJson.version = version;
|
packageJson.version = version;
|
||||||
|
packageLock.version = version;
|
||||||
|
packageLock.packages[""].version = version;
|
||||||
writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
||||||
writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);
|
writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);
|
||||||
|
writeFileSync(packageLockPath, `${JSON.stringify(packageLock, null, 2)}\n`);
|
||||||
console.log(version);
|
console.log(version);
|
||||||
Reference in new issue
Block a user