-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
121 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
# Matches multiple files with brace expansion notation | ||
[*.{js,py,jsx,ts,tsx,json}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Matches the exact files either package.json or .travis.yml | ||
[{package.json,.travis.yml}] | ||
indent_style = space | ||
indent_size = 2 |
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,29 @@ | ||
const prepare = require('../src/prepare') | ||
|
||
const GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE; | ||
|
||
async function run() { | ||
await prepare(); | ||
|
||
// now we can require the action modules | ||
const { getBranchName, setFailed } = require(`../src/utils`); | ||
const core = require('@actions/core'); | ||
|
||
try { | ||
const packageJsonPath = core.getInput('package_json_path') || `${GITHUB_WORKSPACE}/package.json`; | ||
|
||
const packageJson = require(packageJsonPath); | ||
|
||
const branch = getBranchName(); | ||
|
||
core.setOutput('github_branch', branch); | ||
|
||
core.setOutput('package_version', packageJson.version); | ||
core.exportVariable('PACKAGE_VERSION', packageJson.version); | ||
|
||
} catch (error) { | ||
setFailed(error); | ||
} | ||
} | ||
|
||
run(); |
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 |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
"**/node_modules" | ||
], | ||
"include": [ | ||
"index.js", | ||
"src/**/*.js" | ||
"**/*.js" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
|
||
const child_process = require('child_process'); | ||
|
||
const { step } = require(`../src/helpers`); | ||
const { NPM_GLOBAL_DIR, env } = require(`../src/defs`); | ||
|
||
const actionRootDir = `${__dirname}/../`; | ||
const cwd = process.env.GITHUB_WORKSPACE; | ||
|
||
|
||
module.exports = async function () { | ||
/** | ||
* Installing action dependencies before executing any actions | ||
*/ | ||
step('NPM Dir change', () => { | ||
child_process.execSync(`mkdir -p ${NPM_GLOBAL_DIR}`, { | ||
stdio: [0, 1, 2], | ||
cwd, | ||
}); | ||
child_process.execSync(`npm config set prefix '${NPM_GLOBAL_DIR}'`, { | ||
stdio: [0, 1, 2], | ||
cwd, | ||
}); | ||
child_process.execSync(`echo "${NPM_GLOBAL_DIR}/bin" >> $GITHUB_PATH`); | ||
}); | ||
|
||
// make sure that node_modules are installed | ||
step('Npm action modules install', () => { | ||
child_process.execSync('npm install', { | ||
stdio: [0, 1, 2], | ||
cwd: actionRootDir, | ||
env, | ||
}); | ||
}); | ||
|
||
const { npmVersionCheck, getNpmVersion } = require(`../src/utils`); | ||
const core = require('@actions/core'); | ||
// set new npm dir in pipeline paths | ||
core.addPath(`${NPM_GLOBAL_DIR}/bin`); | ||
|
||
step('NPM upgrade', () => { | ||
child_process.execSync(`npm install -g npm@${getNpmVersion()}`, { | ||
stdio: [0, 1, 2], | ||
cwd, | ||
}); | ||
}); | ||
|
||
await npmVersionCheck(); | ||
|
||
} |
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