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

Feature request: Support for private / non-default repositories #124

Closed
aripalo opened this issue Sep 28, 2020 · 4 comments
Closed

Feature request: Support for private / non-default repositories #124

aripalo opened this issue Sep 28, 2020 · 4 comments

Comments

@aripalo
Copy link

aripalo commented Sep 28, 2020

Problem

Currently it seems that Projen only supports the public repositories (npmjs.com, pypi.org, maven central).

This is controlled by jsii-project.ts:

  • for NPM in lines 299-300:
    env: {
       NPM_TOKEN: '${{ secrets.NPM_TOKEN }}',
       NPM_DIST_TAG: this.npmDistTag,
    },
  • for Python in lines 400-401:
    env: {
       TWINE_USERNAME: '${{ secrets.TWINE_USERNAME }}',
       TWINE_PASSWORD: '${{ secrets.TWINE_PASSWORD }}',
    },

Proposed solution

Since jsii-release already supports setting NPM_REGISTRY and TWINE_REPOSITORY_URL this probably could be managed by allowing one to set values in .projenrc.js:

  • options.nodejs.defaultRegistry = false to enable NPM_REGISTRY: '${{ secrets.NPM_REGISTRY }}',
  • options.python.defaultRegistry = false to enable TWINE_REPOSITORY_URL: '${{ secrets.TWINE_REPOSITORY_URL }}',

Related AWS CodeArtifact issues

Then there's the issue of AWS CodeArtifact, which does not provide permanent token, but a temporary token which has a maximum duration of 12 hours (43200 seconds). It would require having some extra step in the Github workflow which might not be that easy to support with projen 🤷‍♂️

@eladb
Copy link
Contributor

eladb commented Sep 29, 2020

Sounds good! contributions are welcome

@eladb
Copy link
Contributor

eladb commented Sep 30, 2020

Let's just add support for specifying the npmRegistryUrl and twineRegistryUrl. They are not secrets...

Regarding codeArtifact, given we have AWS credentials in a GitHub secret (which I am assuming are required for any solution), the workflow can do whatever it needs (like obtaining a token from aws).

@JordanSinko
Copy link
Contributor

@aripalo - Just an FYI... I merged in code to partially accommodate this request with #136 (NPM registry)

mergify bot pushed a commit that referenced this issue Oct 7, 2020
Issue #, if available:
#124 

Description of changes:

This pull request will allow users to release to more than just the default twine repository such as CodeArtifact.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@eladb
Copy link
Contributor

eladb commented Oct 27, 2020

Resolved by #140

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

3 participants