1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-11 12:31:38 +02:00

chore: build dist release-please-action (#302)

This commit is contained in:
google-github-actions-bot
2021-05-03 20:00:08 -05:00
committed by GitHub
parent 0267b45516
commit e3a8d0eb36
9 changed files with 192 additions and 114 deletions

50
dist/commit1.hbs vendored
View File

@@ -1,15 +1,22 @@
*{{#if scope}} **{{scope}}:** * {{header}}
{{~/if}} {{#if subject}}
{{~subject}}
{{~else}}
{{~header}}
{{~/if}}
{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}} {{~!-- commit link --}} {{#if @root.linkReferences~}}
([{{shortHash}}]({{commitUrlFormat}})) ([{{hash}}](
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.commit}}/{{hash}}))
{{~else}} {{~else}}
{{~shortHash}} {{~hash}}
{{~/if}}{{~/if}} {{~/if}}
{{~!-- commit references --}} {{~!-- commit references --}}
{{~#if references~}} {{~#if references~}}
@@ -19,12 +26,31 @@
{{~#if this.owner}} {{~#if this.owner}}
{{~this.owner}}/ {{~this.owner}}/
{{~/if}} {{~/if}}
{{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}}) {{~this.repository}}#{{this.issue}}](
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if this.repository}}
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}
{{~else}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~/if}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.issue}}/{{this.issue}})
{{~else}} {{~else}}
{{~#if this.owner}} {{~#if this.owner}}
{{~this.owner}}/ {{~this.owner}}/
{{~/if}} {{~/if}}
{{~this.repository}}{{this.prefix}}{{this.issue}} {{~this.repository}}#{{this.issue}}
{{~/if}}{{/each}} {{~/if}}{{/each}}
{{~/if}} {{~/if}}

50
dist/commit2.hbs vendored
View File

@@ -1,23 +1,16 @@
* {{header}} *{{#if scope}} **{{scope}}:**
{{~/if}} {{#if subject}}
{{~!-- commit link --}} {{#if @root.linkReferences~}} {{~subject}}
([{{hash}}](
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.commit}}/{{hash}}))
{{~else}} {{~else}}
{{~hash}} {{~header}}
{{~/if}} {{~/if}}
{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
([{{shortHash}}]({{commitUrlFormat}}))
{{~else}}
{{~shortHash}}
{{~/if}}{{~/if}}
{{~!-- commit references --}} {{~!-- commit references --}}
{{~#if references~}} {{~#if references~}}
, closes , closes
@@ -26,31 +19,12 @@
{{~#if this.owner}} {{~#if this.owner}}
{{~this.owner}}/ {{~this.owner}}/
{{~/if}} {{~/if}}
{{~this.repository}}#{{this.issue}}]( {{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if this.repository}}
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}
{{~else}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~/if}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.issue}}/{{this.issue}})
{{~else}} {{~else}}
{{~#if this.owner}} {{~#if this.owner}}
{{~this.owner}}/ {{~this.owner}}/
{{~/if}} {{~/if}}
{{~this.repository}}#{{this.issue}} {{~this.repository}}{{this.prefix}}{{this.issue}}
{{~/if}}{{/each}} {{~/if}}{{/each}}
{{~/if}} {{~/if}}

10
dist/footer.hbs vendored
View File

@@ -0,0 +1,10 @@
{{#if noteGroups}}
{{#each noteGroups}}
### {{title}}
{{#each notes}}
* {{text}}
{{/each}}
{{/each}}
{{/if}}

10
dist/footer1.hbs vendored
View File

@@ -1,10 +0,0 @@
{{#if noteGroups}}
{{#each noteGroups}}
### {{title}}
{{#each notes}}
* {{text}}
{{/each}}
{{/each}}
{{/if}}

22
dist/header1.hbs vendored
View File

@@ -1,13 +1,9 @@
{{#if isPatch~}} ## {{#if isPatch~}} <small>
### {{~/if~}} {{version}}
{{~else~}} {{~#if title}} "{{title}}"
## {{~/if~}}
{{~/if}} {{#if @root.linkCompare~}} {{~#if date}} ({{date}})
[{{version}}]({{compareUrlFormat}}) {{~/if~}}
{{~else}} {{~#if isPatch~}} </small>
{{~version}} {{~/if}}
{{~/if}}
{{~#if title}} "{{title}}"
{{~/if}}
{{~#if date}} ({{date}})
{{/if}}

22
dist/header2.hbs vendored
View File

@@ -1,9 +1,13 @@
## {{#if isPatch~}} <small> {{#if isPatch~}}
{{~/if~}} {{version}} ###
{{~#if title}} "{{title}}" {{~else~}}
{{~/if~}} ##
{{~#if date}} ({{date}}) {{~/if}} {{#if @root.linkCompare~}}
{{~/if~}} [{{version}}]({{compareUrlFormat}})
{{~#if isPatch~}} </small> {{~else}}
{{~/if}} {{~version}}
{{~/if}}
{{~#if title}} "{{title}}"
{{~/if}}
{{~#if date}} ({{date}})
{{/if}}

102
dist/index.js vendored
View File

@@ -14752,6 +14752,7 @@ const compareFunc = __nccwpck_require__(24623)
const Q = __nccwpck_require__(56172) const Q = __nccwpck_require__(56172)
const readFile = Q.denodeify(__nccwpck_require__(35747).readFile) const readFile = Q.denodeify(__nccwpck_require__(35747).readFile)
const resolve = __nccwpck_require__(85622).resolve const resolve = __nccwpck_require__(85622).resolve
const releaseAsRe = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i
/** /**
* Handlebar partials for various property substitutions based on commit context. * Handlebar partials for various property substitutions based on commit context.
@@ -14781,10 +14782,10 @@ module.exports = function (config) {
}) })
return Q.all([ return Q.all([
readFile(__nccwpck_require__.ab + "template1.hbs", 'utf-8'), readFile(__nccwpck_require__.ab + "template2.hbs", 'utf-8'),
readFile(__nccwpck_require__.ab + "header1.hbs", 'utf-8'), readFile(__nccwpck_require__.ab + "header2.hbs", 'utf-8'),
readFile(__nccwpck_require__.ab + "commit1.hbs", 'utf-8'), readFile(__nccwpck_require__.ab + "commit2.hbs", 'utf-8'),
readFile(__nccwpck_require__.ab + "footer.hbs", 'utf-8') readFile(__nccwpck_require__.ab + "footer1.hbs", 'utf-8')
]) ])
.spread((template, header, commit, footer) => { .spread((template, header, commit, footer) => {
const writerOpts = getWriterOpts(config) const writerOpts = getWriterOpts(config)
@@ -14828,6 +14829,13 @@ function getWriterOpts (config) {
// a '!' but no 'BREAKING CHANGE' in body: // a '!' but no 'BREAKING CHANGE' in body:
addBangNotes(commit) addBangNotes(commit)
// Add an entry in the CHANGELOG if special Release-As footer
// is used:
if ((commit.footer && releaseAsRe.test(commit.footer)) ||
(commit.body && releaseAsRe.test(commit.body))) {
discard = false
}
commit.notes.forEach(note => { commit.notes.forEach(note => {
note.title = 'BREAKING CHANGES' note.title = 'BREAKING CHANGES'
discard = false discard = false
@@ -14996,10 +15004,10 @@ function conventionalChangelogWriterInit (context, options) {
includeDetails: false, includeDetails: false,
ignoreReverted: true, ignoreReverted: true,
doFlush: true, doFlush: true,
mainTemplate: readFileSync(__nccwpck_require__.ab + "template2.hbs", 'utf-8'), mainTemplate: readFileSync(__nccwpck_require__.ab + "template1.hbs", 'utf-8'),
headerPartial: readFileSync(__nccwpck_require__.ab + "header2.hbs", 'utf-8'), headerPartial: readFileSync(__nccwpck_require__.ab + "header1.hbs", 'utf-8'),
commitPartial: readFileSync(__nccwpck_require__.ab + "commit2.hbs", 'utf-8'), commitPartial: readFileSync(__nccwpck_require__.ab + "commit1.hbs", 'utf-8'),
footerPartial: readFileSync(__nccwpck_require__.ab + "footer1.hbs", 'utf-8') footerPartial: readFileSync(__nccwpck_require__.ab + "footer.hbs", 'utf-8')
}, options) }, options)
if ((!_.isFunction(options.transform) && _.isObject(options.transform)) || _.isUndefined(options.transform)) { if ((!_.isFunction(options.transform) && _.isObject(options.transform)) || _.isUndefined(options.transform)) {
@@ -22607,11 +22615,26 @@ function resetTmpl (secret, paths) {
}).join('') }).join('')
} }
/**
* Creates the body of the restore function
*
* Restoration of the redacted object happens
* backwards, in reverse order of redactions,
* so that repeated redactions on the same object
* property can be eventually rolled back to the
* original value.
*
* This way dynamic redactions are restored first,
* starting from the last one working backwards and
* followed by the static ones.
*
* @returns {string} the body of the restore function
*/
function restoreTmpl (resetters, paths, hasWildcards) { function restoreTmpl (resetters, paths, hasWildcards) {
const dynamicReset = hasWildcards === true ? ` const dynamicReset = hasWildcards === true ? `
const keys = Object.keys(secret) const keys = Object.keys(secret)
const len = keys.length const len = keys.length
for (var i = ${paths.length}; i < len; i++) { for (var i = len - 1; i >= ${paths.length}; i--) {
const k = keys[i] const k = keys[i]
const o = secret[k] const o = secret[k]
if (o.flat === true) this.groupRestore(o) if (o.flat === true) this.groupRestore(o)
@@ -22622,8 +22645,8 @@ function restoreTmpl (resetters, paths, hasWildcards) {
return ` return `
const secret = this.secret const secret = this.secret
${resetters}
${dynamicReset} ${dynamicReset}
${resetters}
return o return o
` `
} }
@@ -65445,6 +65468,52 @@ exports.GoYoshi = GoYoshi;
/***/ }), /***/ }),
/***/ 72314:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Go = void 0;
const release_pr_1 = __nccwpck_require__(86786);
// Generic
const changelog_1 = __nccwpck_require__(3325);
const DEFAULT_CHANGELOG_PATH = 'CHANGES.md';
class Go extends release_pr_1.ReleasePR {
constructor(options) {
var _a;
super(options);
this.changelogPath = (_a = options.changelogPath) !== null && _a !== void 0 ? _a : DEFAULT_CHANGELOG_PATH;
}
async buildUpdates(changelogEntry, candidate, packageName) {
const updates = [];
updates.push(new changelog_1.Changelog({
path: this.addPath(this.changelogPath),
changelogEntry,
version: candidate.version,
packageName: packageName.name,
}));
return updates;
}
}
exports.Go = Go;
//# sourceMappingURL=go.js.map
/***/ }),
/***/ 42474: /***/ 42474:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
@@ -65538,6 +65607,7 @@ exports.Helm = Helm;
// limitations under the License. // limitations under the License.
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getReleaserTypes = exports.getReleaserNames = exports.getReleasers = void 0; exports.getReleaserTypes = exports.getReleaserNames = exports.getReleasers = void 0;
const go_1 = __nccwpck_require__(72314);
const go_yoshi_1 = __nccwpck_require__(2831); const go_yoshi_1 = __nccwpck_require__(2831);
const java_bom_1 = __nccwpck_require__(54965); const java_bom_1 = __nccwpck_require__(54965);
const java_lts_1 = __nccwpck_require__(79096); const java_lts_1 = __nccwpck_require__(79096);
@@ -65553,7 +65623,7 @@ const rust_1 = __nccwpck_require__(18109);
const ocaml_1 = __nccwpck_require__(26571); const ocaml_1 = __nccwpck_require__(26571);
const helm_1 = __nccwpck_require__(42474); const helm_1 = __nccwpck_require__(42474);
const releasers = { const releasers = {
go: go_yoshi_1.GoYoshi, go: go_1.Go,
'go-yoshi': go_yoshi_1.GoYoshi, 'go-yoshi': go_yoshi_1.GoYoshi,
'java-bom': java_bom_1.JavaBom, 'java-bom': java_bom_1.JavaBom,
'java-lts': java_lts_1.JavaLTS, 'java-lts': java_lts_1.JavaLTS,
@@ -69174,6 +69244,7 @@ function toConventionalChangelogFormat(ast) {
if (parent.type === 'token') { if (parent.type === 'token') {
parent = ancestors.pop(); parent = ancestors.pop();
let footerText = ''; let footerText = '';
const semanticFooter = node.value.toLowerCase() === 'release-as';
visit(parent, ['type', 'scope', 'breaking-change', 'separator', 'text', 'newline'], (node) => { visit(parent, ['type', 'scope', 'breaking-change', 'separator', 'text', 'newline'], (node) => {
switch (node.type) { switch (node.type) {
case 'scope': case 'scope':
@@ -69190,6 +69261,13 @@ function toConventionalChangelogFormat(ast) {
break; break;
} }
}); });
// Any footers that carry semantic meaning, e.g., Release-As, should
// be added to the footer field, for the benefits of post-processing:
if (semanticFooter) {
if (!headerCommit.footer)
headerCommit.footer = '';
headerCommit.footer += `\n${footerText.toLowerCase()}`.trimStart();
}
try { try {
for (const commit of toConventionalChangelogFormat(parser.parser(footerText))) { for (const commit of toConventionalChangelogFormat(parser.parser(footerText))) {
commits.push(commit); commits.push(commit);
@@ -87396,7 +87474,7 @@ module.exports = JSON.parse("{\"_args\":[[\"pino@6.11.3\",\"/home/runner/work/re
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = {"i8":"11.9.0"}; module.exports = {"i8":"11.10.0"};
/***/ }), /***/ }),

20
dist/template1.hbs vendored
View File

@@ -1,23 +1,11 @@
{{> header}} {{> header}}
{{#if noteGroups}}
{{#each noteGroups}}
### ⚠ {{title}}
{{#each notes}}
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
{{/each}}
{{/each}}
{{/if}}
{{#each commitGroups}} {{#each commitGroups}}
{{#if title}}
### {{title}}
{{/if}}
{{#each commits}} {{#each commits}}
{{> commit root=@root}} {{> commit root=@root}}
{{/each}} {{/each}}
{{/each}} {{/each}}
{{> footer}}

20
dist/template2.hbs vendored
View File

@@ -1,11 +1,23 @@
{{> header}} {{> header}}
{{#if noteGroups}}
{{#each noteGroups}}
### ⚠ {{title}}
{{#each notes}}
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
{{/each}}
{{/each}}
{{/if}}
{{#each commitGroups}} {{#each commitGroups}}
{{#if title}}
### {{title}}
{{/if}}
{{#each commits}} {{#each commits}}
{{> commit root=@root}} {{> commit root=@root}}
{{/each}} {{/each}}
{{/each}} {{/each}}
{{> footer}}