mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-10 18:21:15 +02:00
feat!: initial implementation of logic for running release please
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
@@ -1,2 +1,3 @@
|
||||
# release-please-action
|
||||
automated releases based on conventional commits
|
||||
# Release Please Action
|
||||
|
||||
Automate releases based on Conventional Commit Messages.
|
||||
|
||||
13
action.yml
Normal file
13
action.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
name: 'release-please'
|
||||
description: 'automated releases based on conventional commits'
|
||||
author: 'Ben Coe <bencoe@google.com>'
|
||||
inputs:
|
||||
token:
|
||||
description: 'token for creating and grooming release PRs (probably secrets.GITHUB_TOKEN)'
|
||||
required: true
|
||||
release-type:
|
||||
description: 'what type of release is this, e.g., nodejs, java'
|
||||
required: true
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'dist/index.js'
|
||||
2
dist/commit.hbs
vendored
Normal file
2
dist/commit.hbs
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
* {{#if subject}} {{~subject}} {{~else}} {{~header}} {{~/if}}{{#if body}}
|
||||
{{body}}{{~/if}}
|
||||
56
dist/commit1.hbs
vendored
Normal file
56
dist/commit1.hbs
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
* {{header}}
|
||||
|
||||
{{~!-- commit link --}} {{#if @root.linkReferences~}}
|
||||
([{{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}}
|
||||
{{~hash}}
|
||||
{{~/if}}
|
||||
|
||||
{{~!-- commit references --}}
|
||||
{{~#if references~}}
|
||||
, closes
|
||||
{{~#each references}} {{#if @root.linkReferences~}}
|
||||
[
|
||||
{{~#if this.owner}}
|
||||
{{~this.owner}}/
|
||||
{{~/if}}
|
||||
{{~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}}
|
||||
{{~#if this.owner}}
|
||||
{{~this.owner}}/
|
||||
{{~/if}}
|
||||
{{~this.repository}}#{{this.issue}}
|
||||
{{~/if}}{{/each}}
|
||||
{{~/if}}
|
||||
|
||||
30
dist/commit2.hbs
vendored
Normal file
30
dist/commit2.hbs
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
*{{#if scope}} **{{scope}}:**
|
||||
{{~/if}} {{#if subject}}
|
||||
{{~subject}}
|
||||
{{~else}}
|
||||
{{~header}}
|
||||
{{~/if}}
|
||||
|
||||
{{~!-- commit link --}} {{#if @root.linkReferences~}}
|
||||
([{{shortHash}}]({{commitUrlFormat}}))
|
||||
{{~else}}
|
||||
{{~shortHash}}
|
||||
{{~/if}}
|
||||
|
||||
{{~!-- commit references --}}
|
||||
{{~#if references~}}
|
||||
, closes
|
||||
{{~#each references}} {{#if @root.linkReferences~}}
|
||||
[
|
||||
{{~#if this.owner}}
|
||||
{{~this.owner}}/
|
||||
{{~/if}}
|
||||
{{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
|
||||
{{~else}}
|
||||
{{~#if this.owner}}
|
||||
{{~this.owner}}/
|
||||
{{~/if}}
|
||||
{{~this.repository}}{{this.prefix}}{{this.issue}}
|
||||
{{~/if}}{{/each}}
|
||||
{{~/if}}
|
||||
|
||||
10
dist/footer.hbs
vendored
Normal file
10
dist/footer.hbs
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{{#if noteGroups}}
|
||||
{{#each noteGroups}}
|
||||
|
||||
### {{title}}
|
||||
|
||||
{{#each notes}}
|
||||
* {{text}}
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
0
dist/footer1.hbs
vendored
Normal file
0
dist/footer1.hbs
vendored
Normal file
9
dist/header.hbs
vendored
Normal file
9
dist/header.hbs
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
### {{#if @root.linkCompare~}}
|
||||
[{{version}}]({{compareUrlFormat}})
|
||||
{{~else}}
|
||||
{{~version}}
|
||||
{{~/if}}
|
||||
{{~#if title}} "{{title}}"
|
||||
{{~/if}}
|
||||
{{~#if date}} / {{date}}
|
||||
{{/if}}
|
||||
9
dist/header1.hbs
vendored
Normal file
9
dist/header1.hbs
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
## {{#if isPatch~}} <small>
|
||||
{{~/if~}} {{version}}
|
||||
{{~#if title}} "{{title}}"
|
||||
{{~/if~}}
|
||||
{{~#if date}} ({{date}})
|
||||
{{~/if~}}
|
||||
{{~#if isPatch~}} </small>
|
||||
{{~/if}}
|
||||
|
||||
13
dist/header2.hbs
vendored
Normal file
13
dist/header2.hbs
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{{#if isPatch~}}
|
||||
###
|
||||
{{~else~}}
|
||||
##
|
||||
{{~/if}} {{#if @root.linkCompare~}}
|
||||
[{{version}}]({{compareUrlFormat}})
|
||||
{{~else}}
|
||||
{{~version}}
|
||||
{{~/if}}
|
||||
{{~#if title}} "{{title}}"
|
||||
{{~/if}}
|
||||
{{~#if date}} ({{date}})
|
||||
{{/if}}
|
||||
53956
dist/index.js
vendored
Normal file
53956
dist/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
19
dist/template.hbs
vendored
Normal file
19
dist/template.hbs
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{{> header}}
|
||||
{{#if noteGroups}}
|
||||
{{#each noteGroups}}
|
||||
|
||||
#### ⚠ {{title}}
|
||||
|
||||
{{#each notes}}
|
||||
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#each commitGroups}}
|
||||
|
||||
{{#if title}}
|
||||
#### {{title}}
|
||||
|
||||
{{/if}}
|
||||
{{#each commits}}
|
||||
{{> commit root=@root}}{{/each}}{{/each}}
|
||||
11
dist/template1.hbs
vendored
Normal file
11
dist/template1.hbs
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{{> header}}
|
||||
|
||||
{{#each commitGroups}}
|
||||
{{#each commits}}
|
||||
{{> commit root=@root}}
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
|
||||
{{> footer}}
|
||||
|
||||
|
||||
23
dist/template2.hbs
vendored
Normal file
23
dist/template2.hbs
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{{> header}}
|
||||
|
||||
{{#if noteGroups}}
|
||||
{{#each noteGroups}}
|
||||
|
||||
### ⚠ {{title}}
|
||||
|
||||
{{#each notes}}
|
||||
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#each commitGroups}}
|
||||
|
||||
{{#if title}}
|
||||
### {{title}}
|
||||
|
||||
{{/if}}
|
||||
{{#each commits}}
|
||||
{{> commit root=@root}}
|
||||
{{/each}}
|
||||
|
||||
{{/each}}
|
||||
33
index.js
Normal file
33
index.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const core = require('@actions/core')
|
||||
const { ReleasePRFactory } = require('release-please/build/src/release-pr-factory')
|
||||
|
||||
const RELEASE_LABEL = 'autorelease: pending'
|
||||
|
||||
const action = core.getInput('action')
|
||||
|
||||
async function main () {
|
||||
const token = core.getInput('token')
|
||||
const releaseType = core.getInput('release-type')
|
||||
const name = core.getInput('name')
|
||||
|
||||
switch (action) {
|
||||
case 'update-pr': {
|
||||
const release = ReleasePRFactory.build(releaseType, {
|
||||
packageName: name || 'unknown',
|
||||
apiUrl: 'https://api.github.com',
|
||||
repoUrl: process.env.GITHUB_REPOSITORY,
|
||||
token: token,
|
||||
label: RELEASE_LABEL
|
||||
})
|
||||
await release.run()
|
||||
break
|
||||
}
|
||||
default:
|
||||
core.setFailed(`unknown action, ${action}, should be "update-pr", or "create-release".`)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(err => {
|
||||
core.setFailed(`release-please failed to ${action} (${err.message})`)
|
||||
})
|
||||
2949
package-lock.json
generated
Normal file
2949
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
37
package.json
Normal file
37
package.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "release-please-action",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "automated releases based on conventional commits",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "standard",
|
||||
"fix": "standard --fix",
|
||||
"build": "ncc build index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bcoe/release-please-action.git"
|
||||
},
|
||||
"keywords": [
|
||||
"release-please",
|
||||
"action"
|
||||
],
|
||||
"author": "Ben Coe <bencoe@gmail.com>",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bcoe/release-please-action/issues"
|
||||
},
|
||||
"homepage": "https://github.com/bcoe/release-please-action#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.4",
|
||||
"release-please": "^4.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@zeit/ncc": "^0.22.1",
|
||||
"standard": "^14.3.3"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": "dist/"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user