mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 10:33:58 +00:00
set current version
This commit is contained in:
46
.github/workflows/build-npm.yaml
vendored
Normal file
46
.github/workflows/build-npm.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Docker image
|
||||||
|
|
||||||
|
# on: [push]
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
|
||||||
|
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||||
|
|
||||||
|
# on:
|
||||||
|
# push:
|
||||||
|
# branches:
|
||||||
|
# - production
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-18.04]
|
||||||
|
# os: [macOS-10.14, windows-2016, ubuntu-18.04]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Use Node.js 10.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- name: yarn install
|
||||||
|
run: |
|
||||||
|
yarn install
|
||||||
|
- name: setCurrentVersion
|
||||||
|
run: |
|
||||||
|
yarn setCurrentVersion
|
||||||
|
- name: Prepare docker image
|
||||||
|
run: |
|
||||||
|
yarn run prepare:docker
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"version": "3.9.5",
|
||||||
"name": "dbgate-all",
|
"name": "dbgate-all",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|||||||
21
packages/dbgate/package.json
Normal file
21
packages/dbgate/package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "dbgate",
|
||||||
|
"version": "1.0.7",
|
||||||
|
"homepage": "https://dbgate.org/",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/dbshell/dbgate.git"
|
||||||
|
},
|
||||||
|
"funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur",
|
||||||
|
"author": "Jan Prochazka",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"sql",
|
||||||
|
"dbgate",
|
||||||
|
"web"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"dbgate-api": "3.9.5",
|
||||||
|
"dbgate-web": "3.9.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,23 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const packageJson = fs.readFileSync('app/package.json', { encoding: 'utf-8' });
|
const path = require('path');
|
||||||
|
|
||||||
|
function changeDependencies(deps, version) {
|
||||||
|
if (!deps) return;
|
||||||
|
for (const key of Object.keys(deps)) {
|
||||||
|
if (key.startsWith('dbate-')) deps[key] = version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function changePackageFile(path, version) {
|
||||||
|
const text = fs.readFileSync(path.join(path, 'package.json'), { encoding: 'utf-8' });
|
||||||
|
const json = JSON.parse(packageJson);
|
||||||
|
json.version = version;
|
||||||
|
changeDependencies(json.dependencies, version);
|
||||||
|
changeDependencies(json.devDependencies, version);
|
||||||
|
fs.writeFileSync(path.join(path, 'package.json'), JSON.stringify(json, null, 2), { encoding: 'utf-8' });
|
||||||
|
}
|
||||||
|
|
||||||
|
const packageJson = fs.readFileSync('package.json', { encoding: 'utf-8' });
|
||||||
const json = JSON.parse(packageJson);
|
const json = JSON.parse(packageJson);
|
||||||
|
|
||||||
const text = `
|
const text = `
|
||||||
@@ -10,3 +28,10 @@ module.exports = {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
fs.writeFileSync('packages/api/src/currentVersion.js', text);
|
fs.writeFileSync('packages/api/src/currentVersion.js', text);
|
||||||
|
|
||||||
|
changePackageFile('app', json.version);
|
||||||
|
changePackageFile('packages/api', json.version);
|
||||||
|
changePackageFile('packages/sqltree', json.version);
|
||||||
|
changePackageFile('packages/types', json.version);
|
||||||
|
changePackageFile('packages/tools', json.version);
|
||||||
|
changePackageFile('packages/web', json.version);
|
||||||
|
|||||||
Reference in New Issue
Block a user