-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): improve release production flow
- Loading branch information
1 parent
5517c14
commit 3d1c260
Showing
14 changed files
with
182 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Checklist | ||
|
||
TBA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Fork | ||
|
||
## How you can test release flow? | ||
|
||
You need to add your [Github Token](https://github.com/settings/tokens) and set it as `PAT` in your fork's secrets. | ||
|
||
for NPM: | ||
|
||
- Create an NPM account and an organization. (I created @yeager-dev for example) | ||
- Get a token from NPM and set it as `NPM_TOKEN` in our repo. | ||
- Enable Github Actions on your fork. | ||
|
||
_Note 1_: If you are a Rango developer, you can ask NPM token for `@yeager-dev` org. | ||
|
||
For Crowdin: | ||
|
||
After creating a Crowdin project, it has an ID (you can find it in right sidebar) and for accessing to API you will [need a token](https://crowdin.com/settings#api-key) as well. | ||
Then, you need to set `CROWDIN_PERSONAL_TOKEN` and `CROWDIN_PROJECT_ID` in your secrets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Docs | ||
|
||
Here, we are documenting some of our internal processes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Release | ||
|
||
## How we are releasing a new version? | ||
|
||
A release can be a lib or an app/client release. We are publishing our libs to `npm` and deploying our apps (client) on `vercel`. | ||
|
||
If a package is app, you need to add the package name to `scripts/deploy/config.mjs` and then after getting a `PROJECT_ID` from Vercel, you need to set it as enviroment variable as well. | ||
|
||
There are main commands: | ||
|
||
`yarn run publish` for publishing our NPM packages. | ||
`yarn run deploy` to deploy apps on Vercel. | ||
|
||
### Publish flow | ||
|
||
#### Prerelase | ||
|
||
Our publish script will do these steps: | ||
|
||
1. Get the last release (by using git tags) and calculate changes since then. | ||
2. Bump the version for changed packages. | ||
3. Create changelog, git tags and github release, and publish them to NPM. | ||
4. Make a publish commit and push the updated packages (version) and tags to origin. | ||
|
||
Note: | ||
Libs will be published under `next` tag on npm, which means you need to use `yarn add @rango/test-package@next` to install the published version whenever you need. | ||
|
||
#### Production relase | ||
|
||
Release should be triggered manually and then it will automatically published. You only need to run this command on you local machine to release the production: | ||
|
||
`yarn run release-prod` | ||
|
||
### Deploy flow | ||
|
||
You should manually trigger the `deploy` workflow. | ||
|
||
By running `yarn run deploy`, it will build all the apps/clients then will try to deploy them on vercel. | ||
|
||
If the workflow is running on `next` branch, it will be deployed as Vercel's `preview`. If not, it's production release. | ||
|
||
All the apps published by `prerelase` workflow will be published under the Vercel's `preview` enviroment. | ||
|
||
## How you can release a new version? | ||
|
||
### Next (Staging) | ||
|
||
A publish only will be triggered when a **Pull Request** has been merged. If you try to commit directly into the `next` branch it wouldn't be triggered. | ||
|
||
First it tries to extracting translations (if any) and push them onto Crowdin, then releasing libraries will be started. | ||
_Note 1_: Syncing translations (first workflow) is an optional step which means if it fails we will do the publish anyway. | ||
|
||
### Production | ||
|
||
For releasing production, you need to run `yarn release-prod` it will checkout to `next` branch and pull the latest changes then it tries to merge the `next` into `main`. | ||
_Note 1_: Make sure you are having permission for `push` on `main`. | ||
|
||
In production, we don't run localization workflow (crowdin) since we assume our `/translation` folder is in sync with Crowdin. if you think there is new translation, you can run `crowdin` workflow manually and then try to release. | ||
|
||
At the end, a PR will be created to merge `main` into `next` after publishing the libraries. You need to check the PR description and make sure you are considering/doing them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
/** A fixed subject for using in publish commit. */ | ||
export const PUBLISH_COMMIT_SUBJECT = 'chore(release): publish'; | ||
export const NPM_ORG_NAME = '@rango-dev'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.