Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): add automated canary releases #3827

Merged
merged 2 commits into from
Dec 1, 2020
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
26 changes: 26 additions & 0 deletions .github/workflows/canary-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Canary releases

on:
push:
branches:
- master

jobs:
publish-canary:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Installation
run: yarn
- name: Publish Canary release
run: |
yarn canary
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"crowdin:upload:v2": "crowdin upload sources --config ./crowdin-v2.yaml",
"crowdin:uploadTranslations:v2": "crowdin upload translations --config ./crowdin-v2.yaml",
"crowdin:download:v2": "crowdin download --config ./crowdin-v2.yaml",
"canary": "yarn canary:bumpVersion && yarn canary:publish",
"canary:bumpVersion": "yarn lerna version 2.0.0-alpha.`git rev-parse --short HEAD` --exact --no-push --yes",
"canary:publish": "yarn lerna publish from-package --dist-tag canary --yes",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes:

  • tried to use lerna publish --canary but wasn't able to make it work, as it seems to refuse to publish unchanged packages, and to generate a good version name (probably because we already use alpha.patch)
  • from-package should be convenient, as if we try to publish twice the same version, it will just avoid to publish packages that are already published, instead of failing due to trying to publish twice the same version (ex: we restart the CI on same commit: it should still work)

"changelog": "lerna-changelog",
"postinstall": "yarn lock:update && yarn build:packages",
"prettier": "prettier --config .prettierrc --write \"**/*.{js,ts}\"",
Expand Down