Skip to content
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

Need CI/CD setup to build new releases #569

Closed
dave-irvine opened this issue Jun 22, 2018 · 9 comments
Closed

Need CI/CD setup to build new releases #569

dave-irvine opened this issue Jun 22, 2018 · 9 comments

Comments

@dave-irvine
Copy link
Contributor

At the moment building and releasing new versions of twig is a real pain.

Step 1) Update changelog.md with a summary of things fixed
Step 2) Change version number in https://github.com/twigjs/twig.js/blob/master/src/twig.factory.js#L6
Step 3) Run npm run build
Step 4) Run npm version <major¦minor¦patch>
Step 5) Git push

The biggest immediate issue is Step 2, which requires guessing what the next version is going to be and updating the source. If someone can think of a way to add a version tag to the source that comes from the package.json or something similar that'd be great.

https://github.com/zeit/release might resolve Step 1.

Then we just need to automate Steps 3,4,5.

@toptalo
Copy link
Contributor

toptalo commented Jun 22, 2018

Take a look at this webpack plugin https://webpack.js.org/plugins/define-plugin/ and this comment webpack/webpack#237 (comment)
Maybe it helps somehow to resolve Step 2

@dave-irvine
Copy link
Contributor Author

https://github.com/netflix/unleash

@RobLoach
Copy link
Collaborator

RobLoach commented Jul 23, 2018

Change version number

Would it be possible to use...

module.exports = function factory() {
    var Twig = {
        VERSION: require('../package.json').version
    };

?

In addition, I'm more than happy to help with maintaining releases.

@dave-irvine
Copy link
Contributor Author

@RobLoach I gave some thought to that approach, but the package.json version doesn't increment until the npm version script runs, which is run after the code is bundled, so the version the bundler sees would always be one version behind :(

@JorgenEvens
Copy link
Contributor

@dave-irvine That would fully depend on the flow used while creating a new release.

Adding a prepare script to package.json that creates a bundle when npm publish is run should fix the issue you are describing.

"prepare": "npm run build"

Alternatively you could switch around steps 3 and 4, the bundles themselves are not checked into Git, so there should be no difference between the git data before or after the build.

@dave-irvine
Copy link
Contributor Author

Yikes, shows how behind I am on npm, I don't think it even had prepare the last time I checked! Thanks @JorgenEvens I'll investigate.

@RobLoach
Copy link
Collaborator

@dave-irvine Would you like some help with maintaining releases? I'd be willing to help publish this current one if you add me as a maintainer.

@toptalo
Copy link
Contributor

toptalo commented Oct 3, 2018

@willrowe
Copy link
Collaborator

I'm closing this in favor of #815 and #816.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants