ryansonshine / semantic-release-codeartifact Goto Github PK
View Code? Open in Web Editor NEWA semantic-release plugin for publishing packages to AWS CodeArtifact
A semantic-release plugin for publishing packages to AWS CodeArtifact
yarn add --dev semantic-release-codeartifact
semantic-release-codeartifact@npm:2.0.3 doesn't provide @aws-sdk/node-http-handler (p163cd), requested by aws-sdk-v3-proxy
➤ YN0002: │ semantic-release-codeartifact@npm:2.0.3 doesn't provide @aws-sdk/protocol-http (pe111e), requested by aws-sdk-v3-proxy
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code
the package should be installed
If you have a .npmrc
url with an environment variable (in our case the account id) the release will fail when trying to verify the config
[2:02:22 PM] [semantic-release] › ✖ ENPMRCCONFIGMISMATCH Mismatch on CodeArtifact repository and npmrc registry
The registry set in the .npmrc of your project root does not match the CodeArtifact endpoint.
The .npmrc registry is 'https://my-private-${AWS_ACCOUNT_ID}.d.codeartifact.us-east-1.amazonaws.com/npm/my-private/.'
The CodeArtifact endpoint is 'https://my-private-***.d.codeartifact.us-east-1.amazonaws.com/npm/my-private/'.
AggregateError:
SemanticReleaseError: Mismatch on CodeArtifact repository and npmrc registry
at Object.getError (/home/runner/work/design-system/design-system/node_modules/semantic-release-codeartifact/lib/src/get-error.js:11:12)
at /home/runner/work/design-system/design-system/node_modules/semantic-release-codeartifact/lib/src/verify-npm.js:52:41
at Generator.next (<anonymous>)
at fulfilled (/home/runner/work/design-system/design-system/node_modules/semantic-release-codeartifact/lib/src/verify-npm.js:5:58)
at /home/runner/work/design-system/design-system/node_modules/semantic-release/lib/plugins/pipeline.js:54:11
at async Object.pluginsConf.<computed> [as verifyConditions] (/home/runner/work/design-system/design-system/node_modules/semantic-release/lib/plugins/index.js:80:11)
at async run (/home/runner/work/design-system/design-system/node_modules/semantic-release/index.js:103:3)
at async module.exports (/home/runner/work/design-system/design-system/node_modules/semantic-release/index.js:268:22)
at async module.exports (/home/runner/work/design-system/design-system/node_modules/semantic-release/cli.js:[55](https://github.com/morpheus-med/design-system/runs/6371374317?check_suite_focus=true#step:9:55):5)
Should not fail here
.npmrc
fixture to contain an environment variable in the unittests
jared@SleepyGary:~/projects/semantic-release-codeartifact$ git diff
diff --git a/test/fixtures/files/.npmrc b/test/fixtures/files/.npmrc
index a95360a..57d7c96 100644
--- a/test/fixtures/files/.npmrc
+++ b/test/fixtures/files/.npmrc
@@ -1,2 +1,2 @@
-registry=https://my-domain-000000000.d.codeartifact.us-east-1.amazonaws.com/npm/my-repo/
-//my-domain-000000000.d.codeartifact.us-east-1.amazonaws.com/npm/my-repo/:always-auth=true
+registry=https://my-domain-${AWS_ACCOUNT_ID}.d.codeartifact.us-east-1.amazonaws.com/npm/my-repo/
+//my-domain-${AWS_ACCOUNT_ID}.d.codeartifact.us-east-1.amazonaws.com/npm/my-repo/:always-auth=true
AWS_ACCOUNT_ID=000000000 npm test
It's obviously because this is more or less a straight string equality check and I'm not sure what the proper fix should be.
AWS SDK should utilize HTTP_PROXY if present on process.env
Is your feature request related to a problem? Please describe.
Our code artifact is only configured for certain prefixes. (ie: @foo/package). AWS Codeartifact calls them namespaces.
When running the aws configuration command from the cli, it does handle this with the --namespace option.
Describe the solution you'd like
Add another option called namespace (to match the codeartifact name), which will setup the .npmrc with the correct prefix. The entry in the .npmrc will just need to be prefixed with the namespace. @namespace:
.
Describe alternatives you've considered
Just not using the plugin and manually running the aws codeartifact manually in the pipeline.
Sure, I'll throw something together.
Is your feature request related to a problem? Please describe.
Currently, this plugin requires AWS_ACCESS_KEY_ID
& AWS_SECRET_ACCESS_KEY
from the IAM user that we have to create and give this user access to Codeartifact but in my company, they use aws Codeartifact login command to authenticate by session only,
Describe the solution you'd like
can we have a flag withSession
for example to choose which way I need to authenticate in this case, if this flag is false then AWS_ACCESS_KEY_ID
& AWS_SECRET_ACCESS_KEY
will be mandatory if the flag is true then the authentication will be by login session
These should have been done beforehand, but alas, here we are.
When using a specific tool (ie: npm
) we currently check if the @semantic-release/npm
plugin is included in the configuration. If it's not; we throw an error and abort.
If users would like to use a plugin of their own for handling the related tool, we should give them an option to skip the plugin checks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.