Skip to content

Commit 627f015

Browse files
Update crystal release process (#334)
1 parent 0829b02 commit 627f015

File tree

4 files changed

+33
-13
lines changed

4 files changed

+33
-13
lines changed

packages/obs-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ sed -i -e "s/^Version: .*/Version: ${VERSION}-1/" *.dsc
5656
sed -i -e "s/version_suffix .*/version_suffix ${VERSION%.*}/" *.spec
5757
sed -i -e "s/version_current .*/version_current ${VERSION}/" *.spec
5858
sed -i -e "s/version_previous .*/version_previous ${previous_version}/" *.spec
59-
sed -i -e "/%define obsolete_crystal_versioned()/ Obsoletes: %{1}${previous_version%.*}%{?2:-%{2}} \\\\" *.spec
59+
sed -i -e "/%define obsolete_crystal_versioned()/ n;iObsoletes: %{1}${previous_version%.*}%{?2:-%{2}} \\\\" *.spec
6060

6161
sed -i -e "s/^Depends: crystal[^-]*/Depends: crystal${VERSION%.*}/" debian.control
6262
sed -i -e "s/^Version: .*/Version: ${VERSION%.*}/" debian.control

processes/crystal-release.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ Add an issue `Crystal release X.Y.Z` in https://github.com/crystal-lang/distribu
44

55
## Release preparation
66

7-
1. [ ] (minor) Announce expected release date and time span for feature freeze
7+
1. [ ] (minor) Announce expected release date (${RELEASE_DATE}) and time span for feature freeze (starting on ${FREEZE_PERIOD})
88
* (minor) Feature freeze is about two weeks before release
99
* (minor) Set date on milestone
1010
2. [ ] Prepare the changelog entry: [`crystal:scripts/github-changelog.cr`](https://github.com/crystal-lang/crystal/blob/master/scripts/github-changelog.cr)
1111
* Ensure that all merged PRs are added to the milestone (check [`is:pr is:merged sort:updated-desc no:milestone`](https://github.com/crystal-lang/crystal/pulls?q=is%3Apr+is%3Amerged+sort%3Aupdated-desc+no%3Amilestone+-label%3Astatus%3Areverted+base%3Amaster+merged%3A%3E%3D2023-01-01)).
1212
* Ensure that all milestoned PRs are properly labelled (check [`is:pr is:merged sort:updated-desc no:label milestone:${VERSION}`](https://github.com/crystal-lang/crystal/pulls?q=is%3Apr+is%3Amerged+sort%3Aupdated-desc+milestone%3A${VERSION}+no%3Alabel)).
1313
3. [ ] Start preparing release notes
14-
3. [ ] (minor) Start feature freeze period
14+
4. [ ] (minor) Start feature freeze period (on ${FREEZE_PERIOD})
1515
* (minor) Either no merging of features into `master` or split off release branch for backporting bugfixes.
16-
4. [ ] Publish release PR draft
16+
5. [ ] Publish release PR draft
1717
* (minor) It should contain the expected date of the release.
1818
* It should be populated with updates to `CHANGELOG.md`, `src/VERSION` and the version in `shard.yml`.
19-
5. [ ] (minor) Ensure documentation for language and compiler changes and other relevant changes is up to date.
19+
6. [ ] (minor) Ensure documentation for language and compiler changes and other relevant changes is up to date.
2020
* (minor) [Crystal Book](https://github.com/crystal-lang/crystal-book/)
2121
* (minor) Update language specification
2222
* (minor) Update compiler manual
2323
* (minor) Add or update guides / tutorials?
24-
6. [ ] Ensure that [test-ecosystem](https://github.com/crystal-lang/test-ecosystem) functions and succeeeds on master
24+
7. [ ] Ensure that [test-ecosystem](https://github.com/crystal-lang/test-ecosystem) functions and succeeeds on master
2525
* Run [*Test Crystal & Shards Workflow*](https://github.com/crystal-lang/test-ecosystem/actions/workflows/test-crystal-shards.yml)
2626

27-
## Release process
27+
## Release process (on ${RELEASE_DATE})
2828

2929
### Source release
3030

processes/scripts/make-crystal-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ git show
2727

2828
step "Push tag to GitHub" git push --tags
2929

30-
sed -E '3,/^## /!d' CHANGELOG.md | sed '$d' | sed -Ez 's/^\n+//; s/\n+$/\n/g' > CHANGELOG.$VERSION.md
30+
sed -E '7,/^## /!d' CHANGELOG.md | sed '$d' | sed -Ez 's/^\n+//; s/\n+$/\n/g' > CHANGELOG.$VERSION.md
3131

3232
echo "$ more CHANGELOG.$VERSION.md"
3333
more CHANGELOG.$VERSION.md

processes/scripts/prepare-crystal-release.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@
44
#
55
# Usage:
66
#
7-
# scripts/prepare-crystal-release.sh VERSION
7+
# scripts/prepare-crystal-release.sh VERSION RELEASE_DATE FREEZE_PERIOD
88
#
99
# The content is generated from Crystal release checklist (../crystal-release.md)
1010
# with filters applied based on the version type (major, minor, or patch).
1111

1212
set -eu
1313

1414
if [ $# -lt 1 ]; then
15-
echo "Usage: $0 VERSION"
16-
exit 1
17-
fi
15+
printf "Release version: "
16+
read VERSION
1817

19-
VERSION=$1
18+
if [ -z "$VERSION" ]; then
19+
echo "Usage: $0 VERSION"
20+
exit 1
21+
fi
22+
else
23+
VERSION=$1
24+
fi
2025

2126
. $(dirname $(realpath $0))/functions.sh
2227

@@ -32,6 +37,19 @@ case $VERSION in
3237
;;
3338
esac
3439

40+
if [ "$TYPE" != "patch" ]; then
41+
if [ $# -lt 3 ]; then
42+
printf "Scheduled release date: "
43+
read RELEASE_DATE
44+
45+
printf "Freeze period begin: "
46+
read FREEZE_PERIOD
47+
else
48+
RELEASE_DATE=$2
49+
FREEZE_PERIOD=$3
50+
fi
51+
fi
52+
3553
dist_scripts_root=$(dirname $(dirname $(dirname $(realpath $0))))
3654

3755
body=$(sed -E '/^##/,$!d' $dist_scripts_root/processes/crystal-release.md)
@@ -48,5 +66,7 @@ case $TYPE in
4866
;;
4967
esac
5068

69+
body=$(echo "$body" | sed -E "s/\\$\{RELEASE_DATE\}/$RELEASE_DATE/g; s/\\$\{FREEZE_PERIOD\}/$FREEZE_PERIOD/g; s/\\$\{VERSION\}/$VERSION/g; s/\\$\{VERSION%\.\*\}/${VERSION%.*}/g")
70+
5171
body=$(printf "%q" "$body")
5272
step "Create tracking issue in crystal-lang/distribution-scripts" gh issue create -R crystal-lang/distribution-scripts --body "$body" --label "release" --title \"Release Crystal $VERSION\"

0 commit comments

Comments
 (0)