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

Update RELEASE.md to reflect automated release process #294

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Make sure we can lint before creating the release.
- name: Cocoapods lint
run: make cocoapods
- name: Create Release Branch
- name: Create Release Commit
env:
GITHUB_CHANGELOG_API_KEY: ${{ secrets.GITHUB_TOKEN }}
OSS_PROJECT: PINCache
Expand Down
12 changes: 3 additions & 9 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# Release Process
This document describes the process for a public PINCache release.

### Preparation
- Install [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator): `sudo gem install github_changelog_generator`
- Generate a GitHub Personal Access Token to prevent running into public GitHub API rate limits: https://github.com/github-changelog-generator/github-changelog-generator#github-token

### Process
- Run `github_changelog_generator` in PINCache project directory: `github_changelog_generator --token <generated personal token> --user Pinterest --project PINCache`. To avoid hitting rate limit, the generator will replace the entire file with just the changes from this version – revert that giant deletion to get the entire new changelog.
- Update `spec.version` within `PINCache.podspec` and the `since-tag` and `future-release` fields in `.github_changelog_generator`.
- Create a new PR with the updated `PINCache.podspec` and the newly generated changelog, add `#changelog` to the PR message so the CI will not prevent merging it.
- After merging in the PR, [create a new GitHub release](https://github.com/Pinterest/PINCache/releases/new). Use the generated changelog for the new release.
- Push to Cocoapods with `pod trunk push`
- Ensure the latest master build is green.
- Run the github action 'Create Release'.
- Check that the release was successfully published to [Github](https://github.com/pinterest/PINCache/releases) and [Cocoapods](https://cocoapods.org/pods/PINCache).
16 changes: 8 additions & 8 deletions Scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ case $1 in
esac

PODSPEC="$PROJECT.podspec"
CURRENT_VERSION=`grep "version" -m 1 $PODSPEC | sed -E "s/^.*version[ \t]*=[ \t]*'([0-9\.]+)'/\1/"`
DOT_COUNT=`echo "$CURRENT_VERSION" | grep -o '\.' | wc -l`
CURRENT_VERSION=$(grep "version" -m 1 $PODSPEC | sed -E "s/^.*version[ \t]*=[ \t]*['\"]([0-9\.]+)['\"]/\1/")
DOT_COUNT=$(echo "$CURRENT_VERSION" | grep -o '\.' | wc -l)

if [ "$DOT_COUNT" -eq "0" ]; then
major=$CURRENT_VERSION
minor="0"
patch="0"
elif [ "$DOT_COUNT" -eq "1" ]; then
major=`echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)/\1/"`
minor=`echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)/\2/"`
major=$(echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)/\1/")
minor=$(echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)/\2/")
patch="0"
elif [ "$DOT_COUNT" -eq "2" ]; then
major=`echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)\.([0-9]+)/\1/"`
minor=`echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)\.([0-9]+)/\2/"`
patch=`echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)\.([0-9]+)/\3/"`
major=$(echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)\.([0-9]+)/\1/")
minor=$(echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)\.([0-9]+)/\2/")
patch=$(echo "$CURRENT_VERSION" | sed -E "s/([0-9])+\.([0-9]+)\.([0-9]+)/\3/")
fi

echo "Current version: $major.$minor.$patch"
Expand All @@ -72,7 +72,7 @@ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo "New version: $NEW_VERSION"

echo "Updating $PODSPEC"
sed -E "s/^(.*version[ \t]*=[ \t]*)'$CURRENT_VERSION'/\1'$NEW_VERSION'/" $PODSPEC > new.podspec
sed -E "s/^(.*version[ \t]*=[ \t]*)['|\"]$CURRENT_VERSION['|\"]/\1'$NEW_VERSION'/" $PODSPEC > new.podspec
mv new.podspec $PODSPEC

echo "Updating .github_changelog_generator"
Expand Down