Skip to content

chore(): Fix for Travis master and adding a CI/CD pipeline #2072

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
May 20, 2019
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
27 changes: 27 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See go/angularfire-releasing for details on the AngularFire release process.
# If you need to trigger a release manually, be sure to use substitutions like so:
# @canary `gcloud builds submit --substitutions=SHORT_SHA="9b0a0b0"`
# @next `gcloud builds submit --substitutions=TAG_NAME="v1.2.3-rc.1"`
# @latest `gcloud builds submit --substitutions=TAG_NAME="v1.2.3"`
steps:
- name: 'gcr.io/cloud-builders/yarn'
entrypoint: 'bash'
args: ["./tools/build.sh"]
env:
- 'TAG_NAME=$TAG_NAME'
- 'SHORT_SHA=$SHORT_SHA'

- name: 'gcr.io/cloud-builders/yarn'
entrypoint: 'bash'
args: ["./tools/test.sh"]

- name: 'gcr.io/cloud-builders/npm'
entrypoint: 'bash'
env: ['TAG_NAME=$TAG_NAME']
args: ["./tools/release.sh"]
secretEnv: ['NPM_TOKEN']

secrets:
- kmsKeyName: projects/angularfire/locations/global/keyRings/cloud-build/cryptoKeys/cloud-build
secretEnv:
NPM_TOKEN: CiQAwtE8WoPa1sNqAQJZ1WMODuJooVmO6zihz2hAZOfUmDsgogUSTQCq8yp8qgltY+8jWpAR9GuS1JaVhd+fTVRilqLtdi2yXSdiDPTzLhZ+30bMlAOcoc0PxhCBn3JOpn8H1xshX+mG8yK7xog2Uq+CLVx/
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularfire2",
"version": "5.1.2",
"version": "5.2.0",
"description": "The official library of Firebase and Angular.",
"private": true,
"scripts": {
Expand All @@ -12,7 +12,7 @@
"delayed_karma": "sleep 10 && karma start",
"build": "rm -rf dist && node tools/build.js",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"build:wrapper": "npm i --prefix wrapper && VERSION=5.1.2 npm run --prefix wrapper build"
"build:wrapper": "npm i --prefix wrapper && npm run --prefix wrapper build"
},
"keywords": [
"angular",
Expand Down Expand Up @@ -83,7 +83,7 @@
"systemjs": "^0.19.16",
"systemjs-builder": "^0.15.7",
"traceur": "0.0.96",
"typescript": ">=2.7.2 <2.8.0, >=3.1.1 <3.2"
"typescript": ">=3.1.1 <3.2"
},
"typings": "index.d.ts"
}
2 changes: 1 addition & 1 deletion src/database/list/audit-trail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { skipWhile, withLatestFrom, map, scan } from 'rxjs/operators';
export function auditTrail<T>(query: DatabaseQuery, events?: ChildEvent[]): Observable<SnapshotAction<T>[]> {
const auditTrail$ = stateChanges<T>(query, events)
.pipe(
scan<SnapshotAction<T>>((current, action) => [...current, action], [])
scan((current, action) => [...current, action], [])
);
return waitForLoaded<T>(query, auditTrail$);
}
Expand Down
13 changes: 13 additions & 0 deletions tools/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apt-get -y update
apt-get -y install rsync
yarn

if test $TAG_NAME; then
export VERSION=$(echo $TAG_NAME | sed 's/^v\(.*\)$/\1/')
else
export VERSION=$(npm version | head -n 1 | sed "s/^.*: '\([^']*\).*/\1/")-canary.$SHORT_SHA
fi

npm version $VERSION
yarn build
yarn build:wrapper
20 changes: 20 additions & 0 deletions tools/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
cd dist/packages-dist

LATEST_TEST="^v[^-]*$"

if test $TAG_NAME; then
if [[ ! $TAG_NAME =~ $LATEST_TEST ]]; then
npm publish . --tag next
else
npm publish . &&
cd ../wrapper-dist &&
npm publish . &&
npm deprecate angularfire2 "AngularFire has moved, we're now @angular/fire"
fi
else
npm publish . --tag canary
fi

# TODO put this in a shell trap
rm -f .npmrc
10 changes: 10 additions & 0 deletions tools/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list

apt-get -y update
apt-get -y install google-chrome-stable

# TODO parallelize these
npx karma start --single-run --browsers ChromeHeadlessTravis --reporters mocha &&
node tools/run-typings-test.js &&
cd test/ng-build/ng6 && yarn && yarn build:prod
2 changes: 1 addition & 1 deletion wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "git+https://github.com/angular/angularfire2.git"
},
"scripts": {
"build": "rm -rf ../dist/wrapper-dist && tsc -p ./tsconfig.json && rsync -a --include '*.json' --include '*.md' --include '*/' --exclude '*' ./src/ ../dist/wrapper-dist/ && sed -i -- 's/ANGULARFIRE2_VERSION/'\"$VERSION\"'/g' ../dist/wrapper-dist/*.json && sed -i -- 's/ANGULARFIRE2_VERSION/'\"$VERSION\"'/g' ../dist/wrapper-dist/**/*.json && rm ../dist/wrapper-dist/*.json-- && rm ../dist/wrapper-dist/**/*.json--"
"build": "(rm -rf ../dist/wrapper-dist || true) && tsc -p ./tsconfig.json && rsync -a --include '*.json' --include '*.md' --include '*/' --exclude '*' ./src/ ../dist/wrapper-dist/ && sed -i -- 's/ANGULARFIRE2_VERSION/'\"$VERSION\"'/g' ../dist/wrapper-dist/*.json && sed -i -- 's/ANGULARFIRE2_VERSION/'\"$VERSION\"'/g' ../dist/wrapper-dist/**/*.json && (rm ../dist/wrapper-dist/*.json-- || true) && (rm ../dist/wrapper-dist/**/*.json-- || true)"
},
"author": "angular,firebase",
"license": "MIT",
Expand Down
Loading