-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(releases): creating releases in git backend #6854
base: main
Are you sure you want to change the base?
feat(releases): creating releases in git backend #6854
Conversation
83c404c
to
ba158f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great feature to add,
here's my review, note that i'm not part of the decap team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably not link to your repo
@@ -1449,6 +1479,7 @@ export default class API { | |||
author?: GitHubAuthor, | |||
committer?: GitHubCommitter, | |||
) { | |||
console.log(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like it should either be removed or switched to the logging format.
return; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest of the code prefers the .then() syntax, you should probably respect that and write it as:
return await this.api!.listReleases().catch(e => ([]))
); | ||
|
||
return this.request(`${this.repoURL}/releases`) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may want to do error handeling here ?
return this.request(`${this.repoURL}/releases`, { | ||
method: 'POST', | ||
body: JSON.stringify({ tag_name: version }), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -43,10 +43,10 @@ | |||
"jwt-decode": "^3.0.0", | |||
"node-polyglot": "^2.3.0", | |||
"prop-types": "^15.7.2", | |||
"react": "^16.8.4", | |||
"react": "^16.8.4 || ^17.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably justify this react deps bump
"react-dnd": "^14.0.0", | ||
"react-dnd-html5-backend": "^14.0.0", | ||
"react-dom": "^16.8.4", | ||
"react-dom": "^16.8.4 || ^17.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -71,6 +71,7 @@ | |||
"remark-gfm": "1.0.0", | |||
"sanitize-filename": "^1.6.1", | |||
"semaphore": "^1.0.5", | |||
"semver": "^7.5.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please document why you want semver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to conveniently bump the version. will document
@@ -205,6 +208,7 @@ class App extends React.Component { | |||
to={defaultPath} | |||
/> | |||
{hasWorkflow ? <Route path="/workflow" component={Workflow} /> : null} | |||
{isGitBackend ? <Route path="/releases" component={Releases}/> : null } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to only work for github, is checking isGitBackend() enough to ensure we're in GitHub land ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to add implementations for the other providers.
Thanks for this PR which handle a very interesting feature. |
@nioc this is waiting for @jessevanmuijden as it's his idea and PR. If you want this to move faster, you are welcome to contribute too. |
No hurry, I thought the developments were finished and all that remained was to merge. |
This pull request implements this suggestion.
Closes #6884
Summary
Navigate to releases. When you do not have any releases published to your git repository, click the "Create first release" button. Then, Decap will create a release with tag
v0.0.0
in your git repository. When your git repository contains releases, the Releases page displays the latest release version and lists all releases. Also, buttons for bumping the major, minor and patch version will be displayed. Clicking any of these buttons will create a release on the default branch of your git repository that is tagged with the bumped version. This allows you to trigger builds and deploys on tags, as opposed to any commit on your default branch, offering more control and using fewer resources.Motivation
On different hosting providers, like Cloudflare, the number of builds on the free plan is limited. Without editorial workflow, Decap pushes a commit to the main branch every time a user clicks the Publish button on the CMS. In turn, this triggers a build and deploy of the website which is resource intensive. Builds and deploys can be configured to be triggered by a newly pushed tag. Being able to publish a release with a tag from Decap, gives you more control over when your site is built and deployed. As a next step, it would be possible to add pre-releases support, to create preview app deployments on demand, that will allow you to preview a set of changes in the context of your entire site, instead of the - limited - preview window of the CMS.
Test plan
to do
Checklist
POC implementation
releases-2.mov