diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index e9d9864496..8d4f82b4a6 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -10,21 +10,11 @@ assignees: '' ## 1. Preparation on Thursday - [ ] Merge pull requests in the [Ready To Go] column -- [ ] Include translations -
Command line instructions: -
-    
-    git checkout master
-    git pull upstream master
-    tx pull --force
-    git commit -a -m "Update all locales with the latest Transifex translations"
-    git push upstream master
-    
-    
-
-- [ ] Create a tag: - - `script/tag_release` will auto increment patch version, otherwise - - `git push upstream HEAD:refs/tags/vX.Y.Z` +- [ ] Include translations: `script/release/udpate_locales` +- [ ] Increment version number: `git push upstream HEAD:refs/tags/vX.Y.Z` + - Major: if server changes are required (eg. provision with ofn-install) + - Minor: larger change that is irreversible (eg. migration deleting data) + - Patch: all others. Shortcut: `script/release/tag` - [ ] [Draft new release]. Look at previous [releases] for inspiration. - Select new release tag - _Generate release notes_ and check to ensure all items are arranged in the right category. diff --git a/script/release/prepare b/script/release/prepare new file mode 100755 index 0000000000..64eb366a17 --- /dev/null +++ b/script/release/prepare @@ -0,0 +1,13 @@ +#!/bin/sh + +# Execute preparation tasks for a regular patch release. Requires admin permission on the repo. +# +set -e + +# todo: ask to confirm, and remind to check the ready to go column. + +# Download translations and push to master +$(dirname "$0")/update_locales + +# Bump the patch version and push the tag +$(dirname "$0")/tag diff --git a/script/tag_release b/script/release/tag similarity index 84% rename from script/tag_release rename to script/release/tag index 718397ef27..1cdeb103d9 100755 --- a/script/tag_release +++ b/script/release/tag @@ -5,6 +5,8 @@ # This supports only patch releases at the moment but can be developed # further. +puts "\n*** Fetching latest release tag... ***\n" + # Fetch current tags first: `git fetch upstream --tags` @@ -18,7 +20,10 @@ latest_version = Gem::Version.new(latest_tag[1..-1]) major, minor, patch = latest_version.segments next_tag = "v#{major}.#{minor}.#{patch.succ}" +# Push the new tag +puts "\n*** Pushing new release tag #{next_tag}... ***\n" puts `git push upstream 'HEAD:refs/tags/#{next_tag}'` +# Shortcuts puts "Draft a new release with this tag: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=#{next_tag}&title=#{next_tag}+Code+Name" diff --git a/script/release/update_locales b/script/release/update_locales new file mode 100755 index 0000000000..186ea1c262 --- /dev/null +++ b/script/release/update_locales @@ -0,0 +1,23 @@ +#!/bin/sh + +# Download and commit the latest Transifex translations +# + +# Exit on error or uncommitted changes +# TODO: check that master matches upstream/master +set -e +if [ ! -z "$(git status --porcelain)" ]; then + echo "Aborted: git working directory is not clean." + exit 1 +fi + +echo "\n*** Checking out latest master... ***\n" +git checkout master +git pull upstream master + +echo "\n*** Downloading latest Transifex translations... ***\n" +tx pull --force +git commit -a -m "Update all locales with the latest Transifex translations" + +echo "\n*** Pushing to master... ***\n" +git push upstream master