diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 00000000..27b85acf --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,23 @@ +## Pre-release + +Pre-release builds are created automatically for each push to `main`. The builds have the same `major.minor.patch` version as the latest release, but with an additional pre-release identifier `-N`, where `N` is the number of pre-releases since the latest release. For example, if the latest release is `0.0.0` and there have been 5 pre-releases since then, the next pre-release build will be versioned `0.0.0-5`. + +## Stable release + +Stable releases are created by triggering the release pipeline: https://monacotools.visualstudio.com/Monaco/_build?definitionId=631 +To create a stable release, you'll need to specify one of the following release types in the "Release Version" parameter: +- `prerelease`: for creating a pre-release build +- `patch`: for backward-compatible bug fixes +- `minor`: for backward-compatible new features +- `major`: for changes that break backward compatibility + +Most of the time, you'll want to use `patch` or `minor`. For any of the above release types, the version number will be incremented automatically based on the latest stable release. + +To create a stable release at a specific version, you can use `X.X.X` format (e.g., `1.2.3`). In this case, the version number will be set exactly as specified, regardless of the previous latest stable release. + +## Releasing from other branches + +To release from a branch other than `main`, you can choose the branch from the "Select pipeline version by branch/tag" dropdown when you run the pipeline. +Then, specify the desired release type as described above. + +Releasing from other branches is useful for creating recovery releases and pre-releases for testing. \ No newline at end of file diff --git a/build/pipeline.yml b/build/pipeline.yml index 1b0c4fe1..71ef0283 100644 --- a/build/pipeline.yml +++ b/build/pipeline.yml @@ -1,5 +1,3 @@ -name: $(Date:yyyyMMdd)$(Rev:.r) - trigger: branches: include: @@ -15,10 +13,12 @@ resources: endpoint: Monaco parameters: - - name: publishPackage - displayName: 🚀 Publish codicons - type: boolean - default: false + - name: nextVersion + displayName: '🚀 Release Version (eg: none, major, minor, patch, prerelease, or X.X.X)' + type: string + default: 'none' + +name: "$(Date:yyyyMMdd).$(Rev:r)${{ replace(format(' (🚀 {0})', parameters.nextVersion), ' (🚀 none)', '') }}" extends: template: azure-pipelines/npm-package/pipeline.yml@templates @@ -33,4 +33,15 @@ extends: - script: npm run build displayName: Build npm package - publishPackage: ${{ parameters.publishPackage }} + ${{ if or(eq(parameters.nextVersion, 'prerelease'), and(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}: + publishPackage: true + publishRequiresApproval: false + nextVersion: prerelease + tag: next + ${{ elseif eq(parameters.nextVersion, 'none') }}: + publishPackage: false + ${{ else }}: + publishPackage: true + nextVersion: ${{ parameters.nextVersion }} + ghCreateRelease: true + ghReleaseAddChangeLog: true diff --git a/package-lock.json b/package-lock.json index 57919fc0..0de75a39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vscode/codicons", - "version": "0.0.43", + "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vscode/codicons", - "version": "0.0.43", + "version": "0.0.0", "license": "CC-BY-4.0", "devDependencies": { "ansi-regex": ">=5.0.1", diff --git a/package.json b/package.json index b6ae3da8..c600663a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vscode/codicons", - "version": "0.0.43", + "version": "0.0.0", "fontVersion": "1.15", "description": "The icon font for Visual Studio Code", "license": "CC-BY-4.0",