Skip to content

Commit a26c782

Browse files
committed
build: build: move snapshot publish job to circleci
1 parent a9e550e commit a26c782

File tree

5 files changed

+46
-6
lines changed

5 files changed

+46
-6
lines changed

.circleci/config.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,28 @@ jobs:
203203

204204
- *save_cache
205205

206+
# ----------------------------------------
207+
# Job that publishes the build snapshots
208+
# ----------------------------------------
209+
publish_snapshots:
210+
<<: *job_defaults
211+
steps:
212+
# Since CircleCI currently does not have any way to easily restrict jobs to only run
213+
# for push builds, we need to manually skip publishing if the jobs runs for a PR.
214+
# https://discuss.circleci.com/t/workflows-pull-request-filter/14396/11
215+
- run:
216+
name: Check whether this job should be skipped.
217+
command: '[[ -n ${CIRCLE_PR_NUMBER} ]] && circleci step halt || true'
218+
219+
- *checkout_code
220+
- *restore_cache
221+
- *yarn_install
222+
- *attach_release_output
223+
224+
- run: ./scripts/circleci/publish-snapshots.sh
225+
226+
- *save_cache
227+
206228
# ----------------------------------------------------------------------------------------
207229
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
208230
# one job depends on another.
@@ -235,6 +257,9 @@ workflows:
235257
- build_demoapp_aot:
236258
requires:
237259
- build_release_packages
260+
- publish_snapshots:
261+
requires:
262+
- build_release_packages
238263

239264
# Lint workflow. As we want to lint in one job, this is a workflow with just one job.
240265
lint:

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ jobs:
2727
include:
2828
- env: "MODE=payload"
2929
- env: "MODE=saucelabs_required"
30-
- env: "DEPLOY_MODE=build-artifacts"
31-
if: type = push
32-
- env: "DEPLOY_MODE=docs-content"
33-
if: type = push
3430
- env: "DEPLOY_MODE=dashboard"
3531
if: type = cron
3632
env:

scripts/circleci/publish-snapshots.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# This script should fail if one of the individual publish scripts fails.
4+
set -e
5+
6+
# Go to project directory.
7+
cd $(dirname ${0})/../..
8+
9+
# Deploy build artifacts to the GitHub build repositories. The release output is already
10+
# fetched from the CircleCI workspace storage.
11+
./scripts/deploy/publish-build-artifacts.sh --no-build
12+
13+
# Build the docs output before publishing the docs content.
14+
yarn gulp docs
15+
16+
# Deploy the docs content to the Github repository. We don't want to build the examples
17+
# package here again because it's already fetched from the CircleCI workspace storage.
18+
./scripts/deploy/publish-docs-content.sh --no-build
19+

scripts/deploy/publish-build-artifacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ publishPackage() {
3131

3232
buildDir="$(pwd)/dist/releases/${packageName}"
3333
buildVersion=$(node -pe "require('./package.json').version")
34-
branchName=${TRAVIS_BRANCH:-'master'}
34+
branchName=${CIRCLE_BRANCH:-'master'}
3535

3636
commitSha=$(git rev-parse --short HEAD)
3737
commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)

scripts/deploy/publish-docs-content.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ docsContentRepoUrl="https://github.com/angular/material2-docs-content"
3838
buildVersion=$(node -pe "require('./package.json').version")
3939

4040
# Name of the branch that is currently being deployed.
41-
branchName=${TRAVIS_BRANCH:-'master'}
41+
branchName=${CIRCLE_BRANCH:-'master'}
4242

4343
# Additional information about the last commit for docs-content commits.
4444
commitSha=$(git rev-parse --short HEAD)

0 commit comments

Comments
 (0)