Skip to content
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

Add script to create built tag #1209

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ amp.zip
**/*-compiled.js
languages/*.pot
languages/*.php
built
40 changes: 40 additions & 0 deletions bin/tag-built.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -e

tag=$(git describe --tags)
if [[ -z "$tag" ]]; then
echo "Error: Unable to determine tag."
exit 1
fi

built_tag="$tag-built"
if git rev-parse "$built_tag" >/dev/null 2>&1; then
echo "Error: Built tag already exists: $built_tag"
exit 2
fi

if ! git diff-files --quiet || ! git diff-index --quiet --cached HEAD --; then
echo "Error: Repo is in dirty state"
exit 3
fi

git checkout "$tag"
npm run build
mkdir built
git clone . built/
cd built
git checkout $tag
git rm -r $(git ls-files)
rsync -avz ../build/ ./
git add -A .
git commit -m "Build $tag" --no-verify
git tag "$built_tag"
git push origin "$built_tag"
cd ..
git push origin "$built_tag"
rm -rf built

echo "Pushed tag $built_tag."
echo "See https://github.com/Automattic/amp-wp/releases/tag/$built_tag"
echo "For https://github.com/Automattic/amp-wp/releases/tag/$tag"
11 changes: 6 additions & 5 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ Contributors who want to make a new release, follow these steps:
6. Run `npm run deploy` to to commit the plugin to WordPress.org.
7. Confirm the release is available on WordPress.org; try installing it on a WordPress install and confirm it works.
8. Publish GitHub release.
9. Merge release branch into `develop`.
10. Merge release tag into `master`.
11. Publish release blog post, including link to GitHub release.
12. Close the GitHub milestone and project.
13. Make announcements.
9. Create built release tag: `git fetch --tags && git checkout $(git tag | tail -n1) && ./bin/tag-built.sh` (then add link from release)
10. Merge release branch into `develop`.
11. Merge release tag into `master`.
12. Publish release blog post, including link to GitHub release.
13. Close the GitHub milestone and project.
14. Make announcements.