Comments (2)
Hi, to avoid pushing tags and version commits if NPM publish fails you could do this:
- set
--push
to false as the push occurs before post-targets - write a custom post-target "git-push" that pushes the new version
- declare the "git-push" target next to the NPM publish so it's not executed if the publish fails
So it could look like:
"targets": {
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
}
},
"npm-publish": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
}
},
"git-push": {
"command": "git push --atomic --follow-tags"
},
"github-release": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "{tag}",
"notes": "{notes}"
}
}
}
from semver.
Just fyi: If you try something like above, be aware that concurrent commits to your main branch will break the above workflow. This may due to concurrent runs of your release pipeline, or something pushing directly to your main branch. You may end up with a package release to npm without release commit & tag being pushed to your main branch.
I personally find it much easier to have tested & tagged commits in git and have an additional manually-run workflow that, given a tag name, (re)publishes this tag as a package to npm in case a previous publish failed.
from semver.
Related Issues (20)
- Is it possible to exclude some projects when bumping version with synced mode. HOT 1
- Version calculate issue HOT 1
- release as preminor is not increasing the version HOT 4
- commit hash of each changelog content cannot be converted into link HOT 1
- Allow skipping creating tags? HOT 2
- Latest version(v5.1.1) not bumping the version of a project if the changes made to the dependency. HOT 4
- How to pass postTargets as cli args ? HOT 1
- Release version not correlated to previous Prerelease version HOT 5
- @jscutlery/semvver:github executor failing HOT 1
- `{projectName}` interpolation by Nx causes wrong dependencies versions in changelogs
- Possibility to write version info to some file
- Adding `releaseAs=preminor` && `preid=beta` doesn't work as expected HOT 1
- Changelogs are not correctly being generated with custom preset
- Atomic push not working as expected
- `runPostTargets` unexpectedly pass target options as overrideOptions
- release does not consider prerelease tags
- Add support for @nx/devkit v19.0.0 HOT 6
- `Release` does not consider `prerelease` tag
- `@jscutlery:version` executor failing with @nx v19.0.4 HOT 2
- How I can reset semver on existing repository?
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 semver.