Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .azure-devops/graphitation-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pr: none
trigger:
- main
- alloy/relay-apollo-duct-tape

variables:
- group: InfoSec-SecurityResults
Expand Down Expand Up @@ -58,7 +57,14 @@ extends:
git config user.name "Graphitation Service Account"
git fetch --depth=2
displayName: Configure git for release
- script: yarn release -y -n $(ossNpmToken) --access public --no-push --keep-change-files
- script: |
releaseBranch="origin/${BUILD_SOURCEBRANCH#refs/heads/}"

if [ "${BUILD_SOURCEBRANCH}" = "refs/heads/main" ]; then
yarn beachball publish -b "$releaseBranch" -t latest -y -n $(ossNpmToken) --access public --no-push --keep-change-files
else
yarn beachball publish -b "$releaseBranch" -t alpha --prerelease-prefix alpha -y -n $(ossNpmToken) --access public --no-push --keep-change-files
fi
displayName: Release to the npm registry
- script: |
git restore .
Expand All @@ -69,7 +75,14 @@ extends:
- task: npmAuthenticate@0
inputs:
workingFile: ".npmrc"
- script: yarn release -y --registry $(adoNpmFeedBaseUrl)
- script: |
releaseBranch="origin/${BUILD_SOURCEBRANCH#refs/heads/}"

if [ "${BUILD_SOURCEBRANCH}" = "refs/heads/main" ]; then
yarn beachball publish -b "$releaseBranch" -t latest -y --registry $(adoNpmFeedBaseUrl)
else
yarn beachball publish -b "$releaseBranch" -t alpha --prerelease-prefix alpha -y --registry $(adoNpmFeedBaseUrl)
fi
displayName: Release to the ado npm feed
- task: 1ES.PublishPipelineArtifact@1
displayName: 📒 Publish Manifest
Expand Down
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ yarn lint

## Releasing alpha versions

1. Add a branch which will be releasing alpha version to .azure-devops\graphitation-release.yml into `trigger`
2. Change `release` script in the root package json to `yarn beachball publish -t alpha`,
3. Modify package.json of the package you want to release to x.x.x-alpha.0
4. Every time you want to release a new version use `yarn change` and select `prelease`. To avoid patching of dependent packages set `dependentChangeType` to `none` manually in .changes directory
Generraly you need to only run pipeline [microsoft.graphitation](https://dev.azure.com/DomoreexpGithub/Github_Pipelines/_build?definitionId=8) and that is all.

Here described detailed steps of the release process:

1. Make sure you have generated change files for your changes using `yarn change` command.
1. In Azure DevOps run pipeline [microsoft.graphitation](https://dev.azure.com/DomoreexpGithub/Github_Pipelines/_build?definitionId=8)
1. Pipeline automatically adds the `alpha` tag and prefix to the version.
1. The package will be published to npm with the `alpha` tag, so you can install it using `npm i @graphitation/PACKAGE@VERSION-alpha.XX`
1. Bot push the bump commit to the branch.

The core logic is `-b "$releaseBranch" -t alpha --prerelease-prefix alpha` flags for beachball publish command which are added in the [graphitation-release.yml](.azure-devops/graphitation-release.yml#L66) pipeline.



9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"lint": "lage lint --continue",
"lage": "lage",
"ci": "yarn lage build types test lint && yarn checkchange",
"beachball": "beachball -b origin/main",
"change": "yarn beachball change",
"checkchange": "yarn beachball check",
"release": "yarn beachball publish -t latest",
"beachball": "beachball",
"change": "yarn beachball -b origin/main change",
"checkchange": "yarn beachball -b origin/main check",
"postinstall": "patch-package"
},
"devDependencies": {
Expand Down Expand Up @@ -49,4 +48,4 @@
"serialize-javascript": "^7.0.4",
"webpack": "^5.105.4"
}
}
}
Loading