-
Notifications
You must be signed in to change notification settings - Fork 6.8k
chore: create build artifacts for each commit #2082
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e190c16
chore: create build artifacts for each commit
devversion 9537d1b
Switch to new npm package
devversion fbb45d7
Update version to latest
devversion 22d7dba
Publish the builds after all modes succeeded.
devversion 4dc9394
Address comments
devversion 79a380e
Change snake_case to camelCase
devversion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Script which always runs when the current Travis mode succeeds. | ||
# Used to run the travis-after-modes script, which checks if all other modes finished. | ||
|
||
# Go to the project root directory | ||
cd $(dirname $0)/../.. | ||
|
||
npmBin=$(npm bin) | ||
ciResult=$($npmBin/travis-after-modes) | ||
|
||
if [ "$ciResult" = "PASSED" ] && [ -z "$TRAVIS_PULL_REQUEST" ]; then | ||
echo "All travis modes passed. Publishing the build artifacts..." | ||
./scripts/release/publish-build-artifacts.sh | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a top-level comment explaining the purpose of this file |
||
# Script to publish the build artifacts to a GitHub repository. | ||
# Builds will be automatically published once new changes are made to the repository. | ||
|
||
# Go to the project root directory | ||
cd $(dirname $0)/../.. | ||
|
||
buildDir="dist/@angular/material" | ||
buildVersion=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json) | ||
|
||
commitSha=$(git rev-parse --short HEAD) | ||
commitAuthor=$(git --no-pager show -s --format='%an <%ae>' HEAD) | ||
commitMessage=$(git log --oneline | head -n1) | ||
|
||
repoName="material-builds" | ||
repoUrl="http://github.com/DevVersion/material-builds.git" | ||
repoDir="tmp/$repoName" | ||
|
||
# Create a release of the current repository. | ||
$(npm bin)/gulp build:release | ||
|
||
# Prepare cloning the builds repository | ||
rm -rf $repoDir | ||
mkdir -p $repoDir | ||
|
||
# Clone the repository | ||
git clone $repoUrl $repoDir | ||
|
||
# Copy the build files to the repository | ||
rm -rf $repoDir/* | ||
cp -r $buildDir/* $repoDir | ||
|
||
# Create the build commit and push the changes to the repository. | ||
cd $repoDir && | ||
|
||
# Setup the git repository authentication. | ||
git config credential.helper "store --file=.git/credentials" && | ||
echo "$MATERIAL2_BUILDS_TOKEN" > .git/credentials | ||
|
||
git add -A && | ||
git commit -m "$commitMessage" --author "$commitAuthor" && | ||
git tag "$buildVersion-$commitSha" && | ||
git push origin master --tags | ||
|
||
echo "Finished publishing build artifacts" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a top-level comment explaining the purpose of this file