Comments (9)
The release
task on any kind of JsiiProject
is just really bad. The proper fix is to completely get rid of this conditional behavior. I'm very strongly of the opinion now that tasks should behave the same(*) no matter where they are run.
(*) In the relevant bits. They surely can print different things and disable interactive input.
At the moment, the only work around I can offer is for you to run the steps of release
directly.
from projen.
Ah now I'm with you. π All good. We all know that stuff sometimes doesn't translate well I'm text form. I didn't even click that that's your username π€¦
from projen.
I had some time to rework the pipeline today, and it seems that this is working for me:
script:
# abort if the dist directory exists
- "[ ! -x dist ]"
# gitlab-ci checks out a detached HEAD, but the "publish:git" task pushes "main", so make sure the "main" ref exists
- git fetch origin $CI_COMMIT_REF_NAME
- git checkout $CI_COMMIT_REF_NAME
- git branch -v # sanity check
- pnpx projen install:ci
- pnpx projen
- pnpx projen bump
- pnpx projen pre-compile
- pnpx projen compile
- pnpx projen post-compile
- pnpx projen test
- pnpx projen package-all # package has the wrong behaviour when the CI environment variable is defined (replaces dist dir)
- pnpx projen unbump
# push npm packages
- echo "@myscope:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
- pnpm publish --no-git-checks dist/js/*tgz
# push nuget packages
- dotnet nuget add source "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/nuget/index.json" --name gitlab --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text
- dotnet nuget push "dist/dotnet/*.nupkg" --source gitlab
- dotnet nuget push "dist/dotnet/*.snupkg" --source gitlab
- git diff --ignore-space-at-eol --exit-code
# standard origin does not allow pushing, needed by publish:git task
- git remote remove origin || true
- git remote add origin https://$CI_RELEASE_USER:$CI_RELEASE_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH
- pnpx projen publish:git
- Would it be in scope for projen to generate these (gitlab-ci.yaml files) as well?
- How would one start work on supporting such a feature?
P.S.: I did need to use an escape hatch to enable NPM scoped packages, in .projenrc.ts
:
// Can not yet use scoped packages because Projen only supports AWS Code Artifact for scoped packages for the time being.
//
// Error: Only AWS Code artifact scoped registry is supported for now, found https://<redacted>.dev/api/v4/projects/1/packages/npm/
// scopedPackagesOptions: [{
// scope: "@myscope",
// registryUrl: "https://<redacted>.dev/api/v4/projects/1/packages/npm/"
// }],
packageJson.addOverride("publishConfig", {
registry: "https://<redacted>.dev/api/v4/projects/2/packages/npm/",
scope: "@myscope",
});
from projen.
That looks great!
Would it be in scope for projen to generate these (gitlab-ci.yaml files) as well?
How would one start work on supporting such a feature?
Yes, absolutely! I think currently the implementation would be to make the Release component (and other related components) aware of the existence of GitLab and basically to a switch/if depending on which CI/CD systems are available. Most of the GitHub code seems to be in this method: https://github.com/projen/projen/blob/main/src/release/release.ts#L568
As a starting point, can you post the code snippet that is creating your GitLab file?
The end-game for this would be to find a common interface between GitHub Workflows and GitLab Pipelines, so that components like Release
can use a single shared interface, and delegate the implementation details to each system. However this is not something that's currently in the works, and frankly is a bit challenging due to the lack of comparable workflow definitions for multiple systems. So having this available would actually be super helpful.
from projen.
As a starting point, can you post the code snippet that is creating your GitLab file?
rdewaele_editing_in_vim.jpg ππ
I can currently offer no guarantees regarding time to work on a projen feature. I do think I can formulate a use case for my company, so itβs in the cards. Iβll look into it next week.
from projen.
rdewaele_editing_in_vim.jpg ππ
???
I can currently offer no guarantees regarding time to work on a projen feature. I do think I can formulate a use case for my company, so itβs in the cards. Iβll look into it next week.
Yes of course. No worries.
from projen.
???
You were asking about the code that is generating GitLab snippet. There is no such code. The snippet was manually written by me.
from projen.
???
You were asking about the code that is generating GitLab snippet. There is no such code. The snippet was manually written by me.
Okay, but can you share the snippet? Like this was just a filename?!? I'm so confused.
from projen.
Sorry for the confusion.
The script:
section above is part of the .gitlab.yaml
file. I wrote this myself, as in directly by hand.
I understood your question to be about something that generated that script:
section. There is no such thing, and because I wrote it by hand, I jokingly referred to a picture of me typing in vim - as in I am that generator, and a picture of me is βpasting the generator of the pipeline codeβ.
from projen.
Related Issues (20)
- feat(nextjs): ESLint rules
- Vestigial poetry.toml HOT 2
- feat(nextjs): Jest configuration
- feat(subproject): Only release (GitHub Workflow) when that subproject has changed HOT 13
- bug(typescript): projenrc.ts is not properly packageIgnored (still)
- feat(react): Node Library to publish (to NPM) that supports React/JSX HOT 6
- Links in README for built-in project types are broken HOT 1
- AWS CDK CLI not accessible in Python CDK projects HOT 1
- Where to find Project type Docs during Doc Migration to new site? HOT 1
- Fix .gitignore generation on Windows HOT 1
- Allow github release to be explicitly set as latest or explicitly not be latest
- Add dependency via CLI/projen task HOT 2
- feat(typescript): tsconfig paths handled automatically by ts-jest pathsToModuleMapper HOT 3
- cross-platform: use forward slash as directory separator for all platforms HOT 5
- Publishing v0.79.2 to Maven Central failed HOT 3
- `awscdk-app-py` project does not fully respect `--app-entrypoint` value
- Error messages for npx projen new are not helpful HOT 2
- Issues with New Child Project Release Feature and Duplicate Projen Package Installation HOT 16
- Tsconfig CompilerOptions missing `incremental` and `downlevelIteration`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projen.