Skip to content

Commit aa6083b

Browse files
authored
Fix release process (#58)
* Fix release process Fixes minor errors in the release process. Including pushing release branch twice and not pushing snapshot image. Fixes versions not properly set because of Makefile expansion of variables before running rules. Separatating in 2 different rules fixes the problems.
1 parent 8d84501 commit aa6083b

File tree

2 files changed

+34
-15
lines changed

2 files changed

+34
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### 2.1.0 (Next)
22

3+
* [#58](https://github.com/acm19/aws-request-signing-apache-interceptor/issues/58): Test and fix the release process - [@acm19](https://github.com/acm19).
34
* [#59](https://github.com/acm19/aws-request-signing-apache-interceptor/pull/59): Document versioning standard - [@acm19](https://github.com/acm19).
45
* [#44](https://github.com/acm19/aws-request-signing-apache-interceptor/issues/44): Release to Maven Central - [@dblock](https://github.com/dblock), [@acm19](https://github.com/acm19).
56
* [#42](https://github.com/acm19/aws-request-signing-apache-interceptor/pull/42): Add editorconfig - [@acm19](https://github.com/acm19).

Makefile

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,58 @@ release: checkout_master verify create_release prepare_next_development_version
99
.PHONY: checkout_master
1010
.SILENT: checkout_master
1111
checkout_master:
12-
git checkout master && \
12+
git checkout master
1313
git pull
1414

1515
.PHONY: create_release
1616
.SILENT: create_release
17-
create_release:
18-
git checkout -b $(RELEASE_BRANCH) && \
17+
create_release: set_release_version update_release_files_and_commit
18+
19+
.PHONY: set_release_version
20+
.SILENT: set_release_version
21+
set_release_version:
22+
git checkout -b $(RELEASE_BRANCH)
1923
mvn build-helper:parse-version versions:set -DgenerateBackupPoms=false \
20-
-DnewVersion=$$\{parsedVersion.majorVersion\}.$$\{parsedVersion.minorVersion\}.$$\{parsedVersion.incrementalVersion\} && \
21-
sed -i -E "1 s/\\s+\\(Next\\)\s*$$//" CHANGELOG.md && \
22-
git add pom.xml CHANGELOG.md && \
23-
git commit -m "Release version $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" && \
24+
-DnewVersion=$$\{parsedVersion.majorVersion\}.$$\{parsedVersion.minorVersion\}.$$\{parsedVersion.incrementalVersion\}
25+
26+
.PHONY: update_release_files_and_commit
27+
.SILENT: update_release_files_and_commit
28+
update_release_files_and_commit:
29+
DATE=$$(date +%Y\\/%m\\/%d) && \
30+
sed -i -E "1 s/\\s+\\(Next\\)\s*$$/ \\($$DATE\\)/" CHANGELOG.md
31+
git add pom.xml CHANGELOG.md
32+
git commit -m "Release version $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
2433
git push $(REMOTE) $(RELEASE_BRANCH)
2534

2635
.PHONY: prepare_next_development_version
2736
.SILENT: prepare_next_development_version
28-
prepare_next_development_version:
29-
git checkout -b $(SNAPSHOT_BRANCH) && \
37+
prepare_next_development_version: set_next_development_version update_development_files_and_commit
38+
39+
.PHONY: set_next_development_version
40+
.SILENT: set_next_development_version
41+
set_next_development_version:
42+
git checkout -b $(SNAPSHOT_BRANCH)
3043
mvn build-helper:parse-version versions:set -DgenerateBackupPoms=false \
31-
-DnewVersion=$$\{parsedVersion.majorVersion\}.$$\{parsedVersion.minorVersion\}.$$\{parsedVersion.nextIncrementalVersion\}-SNAPSHOT && \
32-
sed -i "1 s/^/### $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout) \(Next\)\\n\\n/" CHANGELOG.md && \
33-
git add pom.xml CHANGELOG.md && \
34-
git commit -m "Prepare for next development iteration $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" && \
35-
git push $(REMOTE) $(RELEASE_BRANCH)
44+
-DnewVersion=$$\{parsedVersion.majorVersion\}.$$\{parsedVersion.minorVersion\}.$$\{parsedVersion.nextIncrementalVersion\}-SNAPSHOT
45+
46+
.PHONY: update_development_files_and_commit
47+
.SILENT: update_development_files_and_commit
48+
update_development_files_and_commit:
49+
sed -i "1 s/^/### $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout) \(Next\)\\n\\n/" CHANGELOG.md
50+
git add pom.xml CHANGELOG.md
51+
git commit -m "Prepare for next development iteration $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
52+
git push $(REMOTE) $(SNAPSHOT_BRANCH)
3653

3754
.PHONY: create_pull_requests
3855
.SILENT: create_pull_requests
3956
create_pull_requests:
40-
gh pr create --base "master" --fill --head $(RELEASE_BRANCH) --title "Release library" && \
57+
gh pr create --base "master" --fill --head $(RELEASE_BRANCH) --title "Release library"
4158
gh pr create --base "master" --fill --head $(SNAPSHOT_BRANCH) --title "Prepare for next development iteration after release" --draft
4259

4360
.PHONY: cleanup_local_branches
4461
.SILENT: cleanup_local_branches
4562
cleanup_local_branches:
63+
git checkout master
4664
git branch -D $(SNAPSHOT_BRANCH) $(RELEASE_BRANCH)
4765

4866
.PHONY: verify

0 commit comments

Comments
 (0)