Skip to content

Commit 1c9ee1d

Browse files
authored
chore(): Fix for Travis master and adding a CI/CD pipeline (#2072)
* The scan type on auditTrail can be implicit now, this solves the TSC 3.1.6 failure * Putting a CI/CD pipeline in place * Bump to package.json to 5.2
1 parent 7108875 commit 1c9ee1d

File tree

8 files changed

+924
-763
lines changed

8 files changed

+924
-763
lines changed

cloudbuild.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See go/angularfire-releasing for details on the AngularFire release process.
2+
# If you need to trigger a release manually, be sure to use substitutions like so:
3+
# @canary `gcloud builds submit --substitutions=SHORT_SHA="9b0a0b0"`
4+
# @next `gcloud builds submit --substitutions=TAG_NAME="v1.2.3-rc.1"`
5+
# @latest `gcloud builds submit --substitutions=TAG_NAME="v1.2.3"`
6+
steps:
7+
- name: 'gcr.io/cloud-builders/yarn'
8+
entrypoint: 'bash'
9+
args: ["./tools/build.sh"]
10+
env:
11+
- 'TAG_NAME=$TAG_NAME'
12+
- 'SHORT_SHA=$SHORT_SHA'
13+
14+
- name: 'gcr.io/cloud-builders/yarn'
15+
entrypoint: 'bash'
16+
args: ["./tools/test.sh"]
17+
18+
- name: 'gcr.io/cloud-builders/npm'
19+
entrypoint: 'bash'
20+
env: ['TAG_NAME=$TAG_NAME']
21+
args: ["./tools/release.sh"]
22+
secretEnv: ['NPM_TOKEN']
23+
24+
secrets:
25+
- kmsKeyName: projects/angularfire/locations/global/keyRings/cloud-build/cryptoKeys/cloud-build
26+
secretEnv:
27+
NPM_TOKEN: CiQAwtE8WoPa1sNqAQJZ1WMODuJooVmO6zihz2hAZOfUmDsgogUSTQCq8yp8qgltY+8jWpAR9GuS1JaVhd+fTVRilqLtdi2yXSdiDPTzLhZ+30bMlAOcoc0PxhCBn3JOpn8H1xshX+mG8yK7xog2Uq+CLVx/

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularfire2",
3-
"version": "5.1.2",
3+
"version": "5.2.0",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
@@ -12,7 +12,7 @@
1212
"delayed_karma": "sleep 10 && karma start",
1313
"build": "rm -rf dist && node tools/build.js",
1414
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
15-
"build:wrapper": "npm i --prefix wrapper && VERSION=5.1.2 npm run --prefix wrapper build"
15+
"build:wrapper": "npm i --prefix wrapper && npm run --prefix wrapper build"
1616
},
1717
"keywords": [
1818
"angular",
@@ -83,7 +83,7 @@
8383
"systemjs": "^0.19.16",
8484
"systemjs-builder": "^0.15.7",
8585
"traceur": "0.0.96",
86-
"typescript": ">=2.7.2 <2.8.0, >=3.1.1 <3.2"
86+
"typescript": ">=3.1.1 <3.2"
8787
},
8888
"typings": "index.d.ts"
8989
}

src/database/list/audit-trail.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { skipWhile, withLatestFrom, map, scan } from 'rxjs/operators';
99
export function auditTrail<T>(query: DatabaseQuery, events?: ChildEvent[]): Observable<SnapshotAction<T>[]> {
1010
const auditTrail$ = stateChanges<T>(query, events)
1111
.pipe(
12-
scan<SnapshotAction<T>>((current, action) => [...current, action], [])
12+
scan((current, action) => [...current, action], [])
1313
);
1414
return waitForLoaded<T>(query, auditTrail$);
1515
}

tools/build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apt-get -y update
2+
apt-get -y install rsync
3+
yarn
4+
5+
if test $TAG_NAME; then
6+
export VERSION=$(echo $TAG_NAME | sed 's/^v\(.*\)$/\1/')
7+
else
8+
export VERSION=$(npm version | head -n 1 | sed "s/^.*: '\([^']*\).*/\1/")-canary.$SHORT_SHA
9+
fi
10+
11+
npm version $VERSION
12+
yarn build
13+
yarn build:wrapper

tools/release.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
2+
cd dist/packages-dist
3+
4+
LATEST_TEST="^v[^-]*$"
5+
6+
if test $TAG_NAME; then
7+
if [[ ! $TAG_NAME =~ $LATEST_TEST ]]; then
8+
npm publish . --tag next
9+
else
10+
npm publish . &&
11+
cd ../wrapper-dist &&
12+
npm publish . &&
13+
npm deprecate angularfire2 "AngularFire has moved, we're now @angular/fire"
14+
fi
15+
else
16+
npm publish . --tag canary
17+
fi
18+
19+
# TODO put this in a shell trap
20+
rm -f .npmrc

tools/test.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
2+
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
3+
4+
apt-get -y update
5+
apt-get -y install google-chrome-stable
6+
7+
# TODO parallelize these
8+
npx karma start --single-run --browsers ChromeHeadlessTravis --reporters mocha &&
9+
node tools/run-typings-test.js &&
10+
cd test/ng-build/ng6 && yarn && yarn build:prod

wrapper/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "git+https://github.com/angular/angularfire2.git"
1010
},
1111
"scripts": {
12-
"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--"
12+
"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)"
1313
},
1414
"author": "angular,firebase",
1515
"license": "MIT",

0 commit comments

Comments
 (0)