Closed travi closed 6 years ago
were there any additional steps that you wanted that don't appear to be covered with this config?
No, that should be all that we need.
but might take a few tries to ensure there aren't kinks to work out
That's okay.
is this a good project to try things out
Absolutely, I would have also chosen Halfred as our guinea pig.
LGTM, let's go ahead with this.
Merged into master. Let's see how this works out :-)
@travi
First build is through. It failed for all versions of Node with
npx: installed 772 in 13.489s
[1:18:16 PM] [semantic-release] › ℹ Running semantic-release version 15.9.16
[1:18:16 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/npm"
[1:18:16 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/github"
[1:18:16 PM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[1:18:16 PM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[1:18:16 PM] [semantic-release] › ✖ An error occurred while running semantic-release: { Error: Cannot find module '@semantic-release/changelog'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at resolveFileName (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:29:39)
at resolveFrom (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:43:9)
at module.exports (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:46:41)
at module.exports (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/normalize.js:19:90)
at castArray.map.pluginOpt (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/index.js:35:9)
at Array.map (<anonymous>)
at Object.entries.reduce (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/index.js:34:43)
at Array.reduce (<anonymous>)
at module.exports (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/index.js:12:55) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module '@semantic-release/changelog'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at resolveFileName (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:29:39)
at resolveFrom (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:43:9)
at module.exports (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:46:41)
at module.exports (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/normalize.js:19:90)
at castArray.map.pluginOpt (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/index.js:35:9)
at Array.map (<anonymous>)
at Object.entries.reduce (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/index.js:34:43)
at Array.reduce (<anonymous>)
at module.exports (/home/travis/.npm/_npx/3880/lib/node_modules/semantic-release/lib/plugins/index.js:12:55) code: 'MODULE_NOT_FOUND' }Script failed with status 1
failed to deploy
My guess would be that modules run via npx look for dependencies in a different place than where npm i -g
installs them?
Also, the fact that it tried to release the package from all sub-builds for each Node version is a bit concerning. Wouldn't we need to constrain semantic release to only run for one Node version (like, 10.x, but not for 4.x - 9.x)? We don't want to publish five releases per Travis build, I guess :-)
Feel free to tinker with this directly in master
if you want to give it another shot.
Found a report with a similar issue and the commit that fixed it for that project: https://github.com/semantic-release/semantic-release/issues/779, fixing commit: https://github.com/texel-sensei/ayayaa/commit/2b555936c68749b6aac2547761a3918e94d61797
They use a shell script that bundles the installation of semantic-release and all required plugins and is executed in the deploy step. Might be the way to go.
I'll try to dig into https://docs.travis-ci.com/user/build-stages a bit more to find out how to only deploy once, after all Node version subbuilds have passed.
Yeah, i think stages is the way to go for the multiple node versions, so i think you're on the right track there. The global dependencies piece is surprising based on my understanding of npx, but i can dig deeper on that tonight.
a few updates:
npm version
, which includes a v
before the version numberi havent cleaned up the partial release so that you could see some of the details of what partially worked. we probably want to revert the changlog update (it looks like i was wrong about it appending to the end of the file. sorry about that). we'll also want to remove the tag (or add an additional one) and update at least the most recent version tag to include the v
, so that semantic-release finds the proper version to increment from
i think i have the build stages sorted out as well, so i think the last piece should hopefully just be sorting out the previous version tag format. once we then remove the tag that was added by semantic-release and re-run it should base the new version on the previous version. it doesnt look like we have any commits that would trigger a release yet, but once we do it should publish successfully after the tag update.
i went ahead and cleaned up the partial release. the interesting details that might be worth taking a look at where the changes made to the changelog
:tada: This PR is included in version 1.1.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
successful release, which confirms that the assets get tied to the github release as well
Super cool!
I changed the .travis.yml a bit more, to also have the greenkeeper step in its own stage, I think this much cleaner than having to restrict it to one Node.js version with the weird shell expressions I used there before. See https://github.com/traverson/halfred/pull/32.
One thing I wonder is why the semantic-release bot impersonates me but it's no big deal.
Great work! Thank you very much!
One thing I wonder is why the semantic-release bot impersonates me but it's no big deal.
this is simply because the GH_TOKEN
hasn't yet been updated to the one for the bot user i created. i'll try to get that updated soon.
as an fyi, i've started moving tokens out of the .travis.yml
and instead set them through the api. they are still encrypted the same way, but can be updated programatically. i've been working on a tool to easily roll a token across many repos, which is the main reason i'm leaning this direction lately, especially after the eslint incident that forced updating tokens.
i think this should configure semantic release to still publish to npm and cut a github release, as it does by default, but also take care of updating and commiting/pushing changelog updates and attaching the
js
files frombrowser/dist/
to the github release.were there any additional steps that you wanted that don't appear to be covered with this config?
my goal is to confirm this config works the way we want and then extract a shareable config to an npm package that gets extended from in this and all the other projects.
i think this config should be close, but might take a few tries to ensure there aren't kinks to work out. is this a good project to try things out with, or do you have another one that you'd recommend moving this to initially.