Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
chore(build): add SHA build version information
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBurleson committed Aug 17, 2017
1 parent f6179fc commit 4d0976d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand Down
12 changes: 5 additions & 7 deletions scripts/deploy/publish-build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ publishPackage() {
packageRepo=${2}

buildDir="dist/releases/${packageName}"
buildVersion=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)
buildVersion=$(node -pe "require('./package.json').version")

commitSha=$(git rev-parse --short HEAD)
commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)
Expand Down Expand Up @@ -62,12 +62,10 @@ publishPackage() {
# Create the build commit and push the changes to the repository.
cd ${repoDir}

# Update the package.json version to include the current commit SHA.
sed -i "s/${buildVersion}/${buildVersion}-${commitSha}/g" package.json

# For build artifacts the different Angular packages that refer to the 0.0.0-PLACEHOLDER should
# be replaced with the Github builds that are published at the same time.
sed -i "s/0.0.0-PLACEHOLDER/${buildVersion}-${commitSha}/g" package.json
# Replace the version in every file recursively with a more specific version that also includes
# the SHA of the current build job. Normally this "sed" call would just replace the version
# placeholder, but the version placeholders have been replaced by the release task already.
sed -i "s/${buildVersion}/${buildVersion}-${commitSha}/g" $(find . -type f)

# Prepare Git for pushing the artifacts to the repository.
git config user.name "${commitAuthorName}"
Expand Down
2 changes: 2 additions & 0 deletions src/lib/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* @description
* Entry point for all public APIs of Angular Flex-Layout.
*/
export * from './version';

export * from './api/index';
export * from './media-query/index';
export * from './utils/index';
Expand Down
12 changes: 12 additions & 0 deletions src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

import {Version} from '@angular/core';

/** Current version of Angular Flex-Layout. */
export const VERSION = new Version('0.0.0-PLACEHOLDER');

0 comments on commit 4d0976d

Please sign in to comment.