Skip to content

chore: setup git before publishing the builds #2197

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 1 commit into from
Dec 13, 2016
Merged
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
18 changes: 11 additions & 7 deletions scripts/release/publish-build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ 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)
commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)
commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)
commitMessage=$(git log --oneline | head -n1)

repoName="material-builds"
Expand All @@ -32,15 +33,18 @@ rm -rf $repoDir/*
cp -r $buildDir/* $repoDir

# Create the build commit and push the changes to the repository.
cd $repoDir &&
cd $repoDir

# Prepare Git for pushing the artifacts to the repository.
git config user.name "$commitAuthorName"
git config user.email "$commitAuthorEmail"
git config credential.helper "store --file=.git/credentials"

# 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 add -A
git commit -m "$commitMessage"
git tag "$buildVersion-$commitSha"
git push origin master --tags

echo "Finished publishing build artifacts"