forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'TryGhost:main' into main
- Loading branch information
Showing
430 changed files
with
13,908 additions
and
4,205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const fs = require('fs/promises'); | ||
const exec = require('util').promisify(require('child_process').exec); | ||
const path = require('path'); | ||
|
||
const core = require('@actions/core'); | ||
const semver = require('semver'); | ||
|
||
(async () => { | ||
const corePackageJsonPath = path.join(__dirname, '../../ghost/core/package.json'); | ||
const corePackageJson = require(corePackageJsonPath); | ||
|
||
const current_version = corePackageJson.version; | ||
console.log(`Current version: ${current_version}`); | ||
|
||
const firstArg = process.argv[2]; | ||
console.log('firstArg', firstArg); | ||
|
||
const buildString = await exec('git rev-parse --short HEAD').then(({stdout}) => stdout.trim()); | ||
|
||
let newVersion; | ||
|
||
if (firstArg === 'canary') { | ||
const bumpedVersion = semver.inc(current_version, 'minor'); | ||
newVersion = `${bumpedVersion}-pre-g${buildString}`; | ||
} else { | ||
const gitVersion = await exec('git describe --long HEAD').then(({stdout}) => stdout.trim().replace(/^v/, '')); | ||
newVersion = gitVersion; | ||
} | ||
|
||
newVersion += '+moya'; | ||
console.log('newVersion', newVersion); | ||
|
||
corePackageJson.version = newVersion; | ||
await fs.writeFile(corePackageJsonPath, JSON.stringify(corePackageJson, null, 2)); | ||
|
||
const adminPackageJsonPath = path.join(__dirname, '../../ghost/admin/package.json'); | ||
const adminPackageJson = require(adminPackageJsonPath); | ||
adminPackageJson.version = newVersion; | ||
await fs.writeFile(adminPackageJsonPath, JSON.stringify(adminPackageJson, null, 2)); | ||
|
||
console.log('Version bumped to', newVersion); | ||
|
||
core.setOutput('BUILD_VERSION', newVersion); | ||
core.setOutput('GIT_COMMIT_HASH', buildString) | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## This file is used to point to the folder where the dashboards are stored | ||
## To edit or create a dashboard, add a .json file to the ./dashboards folder | ||
|
||
apiVersion: 1 | ||
|
||
providers: | ||
- name: "Dashboard provider" | ||
orgId: 1 | ||
type: file | ||
disableDeletion: false | ||
updateIntervalSeconds: 10 | ||
allowUiUpdates: false | ||
options: | ||
path: /var/lib/grafana/dashboards | ||
foldersFromFilesStructure: true |
Oops, something went wrong.