Skip to content

Commit 349cb00

Browse files
authored
simplify the alpha release (#641)
1 parent 905d15f commit 349cb00

3 files changed

Lines changed: 34 additions & 12 deletions

File tree

.azure-devops/graphitation-release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pr: none
22
trigger:
33
- main
4-
- alloy/relay-apollo-duct-tape
54

65
variables:
76
- group: InfoSec-SecurityResults
@@ -58,7 +57,14 @@ extends:
5857
git config user.name "Graphitation Service Account"
5958
git fetch --depth=2
6059
displayName: Configure git for release
61-
- script: yarn release -y -n $(ossNpmToken) --access public --no-push --keep-change-files
60+
- script: |
61+
releaseBranch="origin/${BUILD_SOURCEBRANCH#refs/heads/}"
62+
63+
if [ "${BUILD_SOURCEBRANCH}" = "refs/heads/main" ]; then
64+
yarn beachball publish -b "$releaseBranch" -t latest -y -n $(ossNpmToken) --access public --no-push --keep-change-files
65+
else
66+
yarn beachball publish -b "$releaseBranch" -t alpha --prerelease-prefix alpha -y -n $(ossNpmToken) --access public --no-push --keep-change-files
67+
fi
6268
displayName: Release to the npm registry
6369
- script: |
6470
git restore .
@@ -69,7 +75,14 @@ extends:
6975
- task: npmAuthenticate@0
7076
inputs:
7177
workingFile: ".npmrc"
72-
- script: yarn release -y --registry $(adoNpmFeedBaseUrl)
78+
- script: |
79+
releaseBranch="origin/${BUILD_SOURCEBRANCH#refs/heads/}"
80+
81+
if [ "${BUILD_SOURCEBRANCH}" = "refs/heads/main" ]; then
82+
yarn beachball publish -b "$releaseBranch" -t latest -y --registry $(adoNpmFeedBaseUrl)
83+
else
84+
yarn beachball publish -b "$releaseBranch" -t alpha --prerelease-prefix alpha -y --registry $(adoNpmFeedBaseUrl)
85+
fi
7386
displayName: Release to the ado npm feed
7487
- task: 1ES.PublishPipelineArtifact@1
7588
displayName: 📒 Publish Manifest

CONTRIBUTING.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ yarn lint
5454

5555
## Releasing alpha versions
5656

57-
1. Add a branch which will be releasing alpha version to .azure-devops\graphitation-release.yml into `trigger`
58-
2. Change `release` script in the root package json to `yarn beachball publish -t alpha`,
59-
3. Modify package.json of the package you want to release to x.x.x-alpha.0
60-
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
57+
Generraly you need to only run pipeline [microsoft.graphitation](https://dev.azure.com/DomoreexpGithub/Github_Pipelines/_build?definitionId=8) and that is all.
58+
59+
Here described detailed steps of the release process:
60+
61+
1. Make sure you have generated change files for your changes using `yarn change` command.
62+
1. In Azure DevOps run pipeline [microsoft.graphitation](https://dev.azure.com/DomoreexpGithub/Github_Pipelines/_build?definitionId=8)
63+
1. Pipeline automatically adds the `alpha` tag and prefix to the version.
64+
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`
65+
1. Bot push the bump commit to the branch.
66+
67+
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.
68+
69+
70+

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
"lint": "lage lint --continue",
1818
"lage": "lage",
1919
"ci": "yarn lage build types test lint && yarn checkchange",
20-
"beachball": "beachball -b origin/main",
21-
"change": "yarn beachball change",
22-
"checkchange": "yarn beachball check",
23-
"release": "yarn beachball publish -t latest",
20+
"beachball": "beachball",
21+
"change": "yarn beachball -b origin/main change",
22+
"checkchange": "yarn beachball -b origin/main check",
2423
"postinstall": "patch-package"
2524
},
2625
"devDependencies": {
@@ -49,4 +48,4 @@
4948
"serialize-javascript": "^7.0.4",
5049
"webpack": "^5.105.4"
5150
}
52-
}
51+
}

0 commit comments

Comments
 (0)