Skip to content

Fix canary release flow #3663

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

Merged
merged 5 commits into from
Aug 19, 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
61 changes: 61 additions & 0 deletions .github/workflows/canary-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Canary Deploy

on:
push:
branches:
- master

jobs:
deploy:
name: Canary Deploy
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# Canary release script requires git history and tags.
fetch-depth: 0
- name: Set up Node (10)
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Yarn install
run: yarn
- name: Deploy canary
run: yarn release --canary
env:
NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
NPM_TOKEN_MESSAGING_TYPES: ${{secrets.NPM_TOKEN_MESSAGING_TYPES}}
NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
NPM_TOKEN_POLYFILL: ${{secrets.NPM_TOKEN_POLYFILL}}
NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
NPM_TOKEN_RULES_UNIT_TESTING: ${{secrets.NPM_TOKEN_RULES_UNIT_TESTING}}
NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}}
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
NPM_TOKEN_RXFIRE: ${{secrets.NPM_TOKEN_RXFIRE}}
CI: true
1 change: 1 addition & 0 deletions .github/workflows/check-changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so check_changeset script can diff properly.
fetch-depth: 0
- name: Set up Node (10)
uses: actions/setup-node@v1
with:
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,56 +33,3 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov-all.info
continue-on-error: true
deploy:
name: Canary Deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: test

steps:
- uses: actions/checkout@v2
- name: Checkout
# Canary release script requires git history and tags.
run: git fetch --prune --unshallow
- name: Set up Node (10)
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Yarn install
run: yarn
- name: Deploy canary
run: yarn release --canary
env:
NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
NPM_TOKEN_MESSAGING_TYPES: ${{secrets.NPM_TOKEN_MESSAGING_TYPES}}
NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
NPM_TOKEN_POLYFILL: ${{secrets.NPM_TOKEN_POLYFILL}}
NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}}
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
NPM_TOKEN_RXFIRE: ${{secrets.NPM_TOKEN_RXFIRE}}
CI: true
22 changes: 12 additions & 10 deletions scripts/release/canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ async function publishPackage(pkg: string) {
try {
const path = await mapPkgNameToPkgPath(pkg);

const { private: isPrivate } = JSON.parse(
await readFile(`${path}/package.json`, 'utf8')
);

/**
* Skip private packages
*/
if (isPrivate) return;

/**
* publish args
*/
Expand Down Expand Up @@ -134,9 +125,20 @@ async function publishToNpm(updatedPkgs: string[]) {
* Can't require here because we have a cached version of the required JSON
* in memory and it doesn't contain the updates
*/
const { version } = JSON.parse(
const { version, private: isPrivate } = JSON.parse(
await readFile(`${path}/package.json`, 'utf8')
);

/**
* Skip private packages
*/
if (isPrivate) {
return {
title: `Skipping private package: ${pkg}.`,
task: () => {}
};
}

return {
title: `📦 ${pkg}@${version}`,
task: () => publishPackage(pkg)
Expand Down