Is it possible to only release prereleases with semantic release? - semantic-release

I want to use semantic-release to only publish prereleases.
I have this config in my package.json:
"release": {
"branches": [
{
"name": "main",
"prerelease": "alpha",
"channel": "alpha"
}
]
}
But if I run npx semantic-release I run into the following error:
ERELEASEBRANCHES The release branches are invalid in the `branches` configuration.
A minimum of 1 and a maximum of 3 release branches are required in the branches configuration (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branches).
This may occur if your repository does not have a release branch, such as master.
Your configuration for the problematic branches is [].
As soon as I add another (not prerelease) branch, it works.
Is it possible to only have prerelease branches configured?

I solved this by creating a stable branch that I will not push to. This is not the most elegant solution, but works for now.

Related

Repeated terminal command in VSCode

I'm working on a large angular / .NET Core project and have to type e.g. dotnet run /path/to/subproject in the terminal often.
Can I use VSCode to store/manage these common commands? I've been through the vscode docs on launch.json and tasks.json but cannot find a good answer.
Thanks!
Yes, you have a couple of options.
(1) Set up a command to just rerun the last command - see Make a keybinding to run previous or last shell commands
{
"key": "alt+x", // choose your keybinding
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\u001b[A\u000d" }
},
or (2) just put your frequently-used command into a keybinding ala:
{
"key": "alt+x", // choose your keybinding
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "dotnet run /path/to/subproject\u000d" },
// "when": "terminalFocus"
},
The \u000d is a return so the command runs immediately. I find it easiest to not have the when clause so I can run it from anywhere - editorFocus or terminalFocus, etc.
These go into your keybindings.json.
You can use variables where you have /path/to/subproject. See task - variable substitution and available variables which may help with your path.

Unable to build cordapp with accounts dependencies

I was able to build a cordapp using Accounts by following the steps at https://github.com/corda/accounts.
This cordapp was building and running until 03/16/2020, but since 03/20/2020 I am seeing errors in my CI builds because https://ci-artifactory.corda.r3cev.com/artifactory/corda-lib-dev/com/r3/corda/lib/accounts/accounts-contracts/1.0-RC04/accounts-contracts-1.0-RC04.jar cannot be accessed. I get a 409 response now, how can I resolve this?
{
"errors" : [ {
"status" : 409,
"message" : "The repository 'corda-lib-dev' rejected the resolution of an artifact 'corda-lib-dev:com/r3/corda/lib/accounts/accounts-contracts/1.0-RC04/accounts-contracts-1.0-RC04.jar' due to conflict in the snapshot release handling policy."
} ]
}
My build.gradle has
accounts_release_version = '1.0-RC04'
accounts_release_group = 'com.r3.corda.lib.accounts'
confidential_id_release_group = "com.r3.corda.lib.ci"
confidential_id_release_version = "1.0-RC03"
repositories {
maven { url 'http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib-dev' }
maven { url 'http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib' }
}
My local builds on my development environment work fine, I assume because I already have the jars in my .m2
Artifactory configuration has been changed to enforce separation between release and snapshot repositories. corda-lib-dev is a snapshot repo and CorDapp developers should not be developing against these.
Releases and release candidates will be available in corda-lib going forward.
Kindly use corda-lib, and develop again release 1.0.
The pom file with RC04 is set to return 409. I assume Corda's way to disallow use of RC04. May be RC03 is also the same. I just tried this today and saw the repository pom files.
Use "1.0" instead of "1.0-RC03"

How to delete a Artifactory build without artifacts?

We somehow managed to create a 'build' in Artifactory that does not have any artifacts (files) associated with it.
Through the web interface I only seem to be able to delete all builds for that particular release - which I obviously don't want.
Assuming we have 3 good 'builds' (has files etc.):
Moon -- 12.3 Build 23
Moon -- 12.4 Build 34
Moon -- 12.5 Build 89
and the aforementioned bad 'build'
Moon -- 12.0 Build 100
In the WebUI, 'Moon #12.0 Build 100' is listed in 'Last Deployed Builds' and also shows up as '12.0 Build 100' under 'Builds' for the 'Moon' release.
How do I delete the '12.0 Build 100' from Artifactory?
The WebUI seems to only allow deletion of all 'Moon' builds.
If the WebUI is a no go, how would I do so using the JFrog CLI or curl?
I am already having trouble coming up with the correct file spec to even find the 'build' - and obviously don't want to accidentally wipe out artifacts we want to keep.
{
"files": [
{
"pattern": "/api/build/Moon"
}
]
}
... doesn't return anything
{
"files": [
{
"pattern": "my-repo/Moon/*"
}
]
}
... returns all artifacts - but not the builds.
Thank you for any advice.
You can delete a specific build is using the delete builds REST API, for example
curl -X DELETE http://myserver:8081/artifactory/api/build/my-build?buildNumbers=100
In the upcoming version of Artifactory - 6.6, there will be a new option to delete a specific build from the UI (assuming you have the right permissions).

when running jasmine task in grunt, getting an error "glob pattern string required"

I am trying to run jasmine test using grunt-contrib-jasmine
Below is my Gruntfile.js code
module.exports = function(grunt) {
grunt.initConfig({
jasmine : {
// Your project's source files
src : 'src/**/*.js',
// Your Jasmine spec files
specs : 'specs/**/*spec.js',
// Your spec helper files
helpers : 'specs/helpers/*.js'
}
});
// Register tasks.
grunt.loadNpmTasks('grunt-contrib-jasmine');
// Default task.
grunt.registerTask('default', 'jasmine');
};
Then I tried running "grunt jasmine" command from command prompt. It gives me an error like below
The issue you're describing was reported in this grunt issue. It was then fixed in this commit to grunt-contrib-jasmine on February 13 2016.
As of this writing, the most recent release of grunt-contrib-jasmine is v1.0.0, released on January 26 2016. So, the fix didn't make it into the most recent release, which is what NPM pulls when you do an install.
You can get around this by bypassing the NPM repository and going straight to GitHub for a prerelease version of grunt-contrib-jasmine. You do this by changing your package.json to read:
"dependencies: {
"grunt-contrib-jasmine": "git://github.com/gruntjs/grunt-contrib-jasmine#1e78d891704fa13fe7c7abf4cabf43cefacafcaf"
}
(The commit SHA in the URL just happens to be the most recent one at the time of this writing; feel free to replace it with a later one if you like.)
Ideally, this solution will become obsolete, when grunt-contrib-jasmine releases v1.0.1 (or higher) with the fix commit. Today though, this is what fixed the problem for me.

gclient runhooks fails

I'm trying to build Chrome under windows, I got the chromium trunk using tortoiseSVN and I believe I got everything correctly, but when I run "gclient runhooks" I get the error: "Error: client not configured; see 'gclient config'".
Now, I know that it happens because I don't have a ".gclient" file on the same directory, but I couldn't find .gclient file anywhere in the project. I tried to create .gclient file myself but it says there's a solution missing.
I'm probably missing something, can anyone help me with that? I'm pretty stuck!
Thanks!
gclient config http://src.chromium.org/svn/trunk/src
gclient runhooks
Or make a .gclient file with the following content, which skips the huge amount of webkit layout tests
solutions = [
{ "name" : "src",
"url" : "http://src.chromium.org/svn/trunk/src",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
"src/third_party/WebKit/LayoutTests": None,
"src/chrome_frame/tools/test/reference_build/chrome": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/chrome/tools/test/reference_build/chrome_win": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
},
"safesync_url": "",
},
]
The above solution is out-dated. Running with the SVN repository results in:
Error:
The chromium code repository has migrated completely to git.
Your SVN-based checkout is now obsolete; you need to create a brand-new
git checkout by following these instructions:
http://www.chromium.org/developers/how-tos/get-the-code
Now you need to create a .gclient file like this
solutions = [
{
"managed": False,
"name": "src",
"url": "https://chromium.googlesource.com/chromium/src.git",
"custom_deps": {},
"deps_file": ".DEPS.git",
"safesync_url": "",
},
]
and do:
gclient sync
Chromium does not include a preconfigured .gclient file for the Chromium build and does not automatically handle Visual Studio versioning changes and default Deploy toolkit hints. After you have successfully downloaded the deploy tools and the chromium source code as provided at chromium.org perform the following in the root directory where your deploy_tools and src code is located.
NOTE : If you receive errors try to start a new command prompt session and try again.
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION = 2015
gclient config https://chromium.googlesource.com/chromium/src.git
gclient sync
gclient runhooks
cd src
ninja -C out\Debug chrome
The build will take some time gclient runhooks should generate the build folder.

Resources