Skip to content

Commit

Permalink
⬆️ update to node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
rsking committed Mar 21, 2024
1 parent e31951a commit a22bbc7
Show file tree
Hide file tree
Showing 4 changed files with 4,856 additions and 4,151 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# GitHub Action for Semantic Versioning, Version 2
# GitHub Action for Semantic Versioning, Version 3

[![GitHub Actions status](https://github.com/altavec/semver/workflows/build-test/badge.svg)](https://github.com/altavec/semver/actions)

This action installs the CLI for [Altvec.SemanticVersioning](https://github.com/altavec/SemanticVersioning) and exposes version data from it as action outputs.

The main change from version 2 to version 3 is updating the NODE version to 18.
The main change from version 1 to version 2 is installing and using `Altavec.SemanticVersioning` rather than `Mondo.SemanticVersioning`.

## Inputs
Expand Down
374 changes: 187 additions & 187 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,107 +5,107 @@
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(534));
const os = __importStar(__nccwpck_require__(37));
const path = __importStar(__nccwpck_require__(17));
const settings_1 = __nccwpck_require__(244);
const exec_1 = __nccwpck_require__(58);
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
if (settings_1.Inputs.workingDirectory) {
core.info(`changing directory to ${settings_1.Inputs.workingDirectory}`);
process.chdir(settings_1.Inputs.workingDirectory);
}
// install semver
const installArgs = ['tool', 'install', '-g', 'Altavec.SemanticVersioning'];
if (settings_1.Inputs.toolVersion) {
installArgs.push('--version', settings_1.Inputs.toolVersion);
}
if (settings_1.Inputs.source) {
installArgs.push('--add-source', settings_1.Inputs.source);
}
if (settings_1.Inputs.configfile) {
installArgs.push('--configfile', settings_1.Inputs.configfile);
}
const exitCode = yield (0, exec_1.exec)('dotnet', installArgs, { ignoreReturnCode: true });
if (exitCode > 1) {
throw new Error('dotnet tool install failed.');
}
// Collect a JSON string of all the version properties.
const args = ['diff', 'solution'];
if (settings_1.Inputs.solution) {
args.push(settings_1.Inputs.solution);
}
if (settings_1.Inputs.isDefaultBranch) {
args.push('--no-version-suffix');
}
if (settings_1.Inputs.versionSuffix) {
args.push('--version-suffix', settings_1.Inputs.versionSuffix);
}
if (settings_1.Inputs.source) {
args.push('--source', settings_1.Inputs.source);
}
if (settings_1.Inputs.increment) {
args.push('--increment', settings_1.Inputs.increment);
}
args.push('--output', 'Json', '--direct-download', '--package-id-regex', settings_1.Inputs.packageIdRegex, '--package-id-replace', settings_1.Inputs.packageIdReplace, '--nologo');
const toolPath = path.join(os.homedir(), '.dotnet', 'tools', 'dotnet-semver');
let versionJson = '';
yield (0, exec_1.exec)(toolPath, args, {
listeners: {
stdout: (data) => {
versionJson += data.toString();
}
}
});
core.setOutput('versionJson', versionJson);
// Break up the JSON into individual outputs.
const versionProperties = JSON.parse(versionJson);
for (const name in versionProperties) {
core.setOutput(name, versionProperties[name]);
}
}
catch (error) {
core.setFailed(error.message);
}
});
}
run();

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(534));
const os = __importStar(__nccwpck_require__(37));
const path = __importStar(__nccwpck_require__(17));
const settings_1 = __nccwpck_require__(244);
const exec_1 = __nccwpck_require__(58);
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
if (settings_1.Inputs.workingDirectory) {
core.info(`changing directory to ${settings_1.Inputs.workingDirectory}`);
process.chdir(settings_1.Inputs.workingDirectory);
}
// install semver
const installArgs = ['tool', 'install', '-g', 'Altavec.SemanticVersioning'];
if (settings_1.Inputs.toolVersion) {
installArgs.push('--version', settings_1.Inputs.toolVersion);
}
if (settings_1.Inputs.source) {
installArgs.push('--add-source', settings_1.Inputs.source);
}
if (settings_1.Inputs.configfile) {
installArgs.push('--configfile', settings_1.Inputs.configfile);
}
const exitCode = yield (0, exec_1.exec)('dotnet', installArgs, { ignoreReturnCode: true });
if (exitCode > 1) {
throw new Error('dotnet tool install failed.');
}
// Collect a JSON string of all the version properties.
const args = ['diff', 'solution'];
if (settings_1.Inputs.solution) {
args.push(settings_1.Inputs.solution);
}
if (settings_1.Inputs.isDefaultBranch) {
args.push('--no-version-suffix');
}
if (settings_1.Inputs.versionSuffix) {
args.push('--version-suffix', settings_1.Inputs.versionSuffix);
}
if (settings_1.Inputs.source) {
args.push('--source', settings_1.Inputs.source);
}
if (settings_1.Inputs.increment) {
args.push('--increment', settings_1.Inputs.increment);
}
args.push('--output', 'Json', '--direct-download', '--package-id-regex', settings_1.Inputs.packageIdRegex, '--package-id-replace', settings_1.Inputs.packageIdReplace, '--nologo');
const toolPath = path.join(os.homedir(), '.dotnet', 'tools', 'dotnet-semver');
let versionJson = '';
yield (0, exec_1.exec)(toolPath, args, {
listeners: {
stdout: (data) => {
versionJson += data.toString();
}
}
});
core.setOutput('versionJson', versionJson);
// Break up the JSON into individual outputs.
const versionProperties = JSON.parse(versionJson);
for (const name in versionProperties) {
core.setOutput(name, versionProperties[name]);
}
}
catch (error) {
core.setFailed(error.message);
}
});
}
run();


/***/ }),
Expand All @@ -114,92 +114,92 @@ run();
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Inputs = void 0;
const core = __importStar(__nccwpck_require__(534));
class Inputs {
// install arguments
static get source() {
const result = core.getInput('source');
return result === '' || result === null ? undefined : result;
}
static get configfile() {
const result = core.getInput('configfile');
return result === '' || result === null ? undefined : result;
}
static get toolVersion() {
const result = core.getInput('toolVersion');
return result === '' || result === null ? undefined : result;
}
// run arguments
static get solution() {
const result = core.getInput('solution');
return result === '' || result === null ? undefined : result;
}
static get isDefaultBranch() {
return core.getInput('isDefaultBranch') === 'true';
}
static get versionSuffix() {
let result = core.getInput('versionSuffix');
if (result === '' || result === null) {
return undefined;
}
if (result.startsWith('refs/')) {
result = result.replace('refs/heads/', '');
}
else if (result.startsWith('\\refs\\')) {
result = result.replace('\\refs\\heads\\', '');
}
if (result.includes('/')) {
result = result.replace('/', '+');
}
else if (result.includes('\\')) {
result = result.replace('\\', '+');
}
return result;
}
static get increment() {
const result = core.getInput('increment');
return result === '' || result === null ? undefined : result;
}
static get packageIdRegex() {
const result = core.getInput('packageIdRegex');
return result === '' || result === null ? 'Altavec' : result;
}
static get packageIdReplace() {
const result = core.getInput('packageIdReplace');
return result === '' || result === null ? 'Mondo' : result;
}
static get workingDirectory() {
const result = core.getInput('workingDirectory');
return result === '' || result === null ? undefined : result;
}
}
exports.Inputs = Inputs;

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Inputs = void 0;
const core = __importStar(__nccwpck_require__(534));
class Inputs {
// install arguments
static get source() {
const result = core.getInput('source');
return result === '' || result === null ? undefined : result;
}
static get configfile() {
const result = core.getInput('configfile');
return result === '' || result === null ? undefined : result;
}
static get toolVersion() {
const result = core.getInput('toolVersion');
return result === '' || result === null ? undefined : result;
}
// run arguments
static get solution() {
const result = core.getInput('solution');
return result === '' || result === null ? undefined : result;
}
static get isDefaultBranch() {
return core.getInput('isDefaultBranch') === 'true';
}
static get versionSuffix() {
let result = core.getInput('versionSuffix');
if (result === '' || result === null) {
return undefined;
}
if (result.startsWith('refs/')) {
result = result.replace('refs/heads/', '');
}
else if (result.startsWith('\\refs\\')) {
result = result.replace('\\refs\\heads\\', '');
}
if (result.includes('/')) {
result = result.replace('/', '+');
}
else if (result.includes('\\')) {
result = result.replace('\\', '+');
}
return result;
}
static get increment() {
const result = core.getInput('increment');
return result === '' || result === null ? undefined : result;
}
static get packageIdRegex() {
const result = core.getInput('packageIdRegex');
return result === '' || result === null ? 'Altavec' : result;
}
static get packageIdReplace() {
const result = core.getInput('packageIdReplace');
return result === '' || result === null ? 'Mondo' : result;
}
static get workingDirectory() {
const result = core.getInput('workingDirectory');
return result === '' || result === null ? undefined : result;
}
}
exports.Inputs = Inputs;


/***/ }),
Expand Down
Loading

0 comments on commit a22bbc7

Please sign in to comment.