Skip to content

Commit 27c57e5

Browse files
committed
add version updater
- script to update our versions after a release - cleanup some git ignore files - other minor version related doc cleanup Signed-off-by: Appu Goundan <[email protected]>
1 parent 7cc85ad commit 27c57e5

File tree

9 files changed

+59
-88
lines changed

9 files changed

+59
-88
lines changed

.github/ISSUE_TEMPLATE/release-checklist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ Full release instructions are at: [RELEASING.md](/sigstore/sigstore-java/blob/ma
2020
- [ ] [sigstore-java](https://repo1.maven.org/maven2/dev/sigstore/sigstore-java)
2121
- [ ] [sigstore-maven-plugin](https://repo1.maven.org/maven2/dev/sigstore/sigstore-maven-plugin)
2222
- [ ] sigstore-gradle-plugin [[base](https://plugins.gradle.org/plugin/dev.sigstore.sign-base)], [[sign](https://plugins.gradle.org/plugin/dev.sigstore.sign)]
23+
24+
## Post Release
25+
- [ ] Update README if required
26+
- [ ] Update versions (`./scripts/update_version.sh`)
27+
- [ ] Update CHANGELOG.md

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
.gradle
22
/build
3-
/*/build
3+
/**/build
44
/out
5-
/*/out
5+
/**/out
66
/http
77

8+
/target
9+
/**/target
10+
.mvn/timing.properties
11+
.mvn/wrapper/maven-wrapper.jar
12+
813
# For occasional use of https://github.com/melix/includegit-gradle-plugin
914
/checkouts
1015

@@ -20,6 +25,9 @@
2025
.classpath
2126
.project
2227
.DS_Store
28+
.vscode
29+
.factorypath
2330

2431
# except this icon
2532
!/.idea/icon.png
33+

RELEASING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Release is done on github. Do not release from your local machine.
44

5+
## Create an issue
6+
7+
Create a release issue using the release template
8+
59
## Create a tag
610

711
Tag the release at the version you wish (ex `v0.5.3`), this *MUST* match the project version (`0.5.3`). See version info in [gradle.properties](gradle.properties).

gradle.properties

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
44

55
group=dev.sigstore
66

7-
# remember to also update version in
8-
# - SigstoreSignExtension.kt
9-
# - build-logic/publishing/build.gradle.kts
7+
# use the ./scripts/update_version.sh script to update all versions
108
version=0.12.0

scripts/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/sign_and_bundle_release.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

scripts/update_versions.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# this script is simple and should work for most usecases, but it may break if we do weird things
4+
set -Eeo pipefail
5+
6+
calculated_release_version=$(grep "^version=" gradle.properties | cut -d'=' -f2)
7+
read -r -p "Enter released version [${calculated_release_version}]: " vin
8+
release_version=${vin:-${calculated_release_version}}
9+
10+
calculated_previous_version=$(grep "sigstore-gradle-sign-plugin" build-logic/publishing/build.gradle.kts | cut -d':' -f3 | cut -d'"' -f1)
11+
read -r -p "Enter previous version [${calculated_previous_version}]: " pvin
12+
previous_version=${pvin:-${calculated_previous_version}}
13+
14+
calculated_next_version=$(echo "$release_version" | awk -F. -v OFS=. '{$2 += 1 ; print}')
15+
read -r -p "Enter next version [${calculated_next_version}]: " nvin
16+
next_version=${nvin:-${calculated_next_version}}
17+
18+
echo ""
19+
echo "previous: $previous_version"
20+
echo "latest : $release_version"
21+
echo "next : $next_version"
22+
read -r -p "Run update? [y/N]: " yn
23+
go=${yn:-"n"}
24+
if [ "${go,,}" != "y" ]; then
25+
echo "aborting"
26+
exit
27+
fi
28+
29+
# sed below is probably accepting .'s in versions as regex any chars, but this works for our purposes
30+
31+
# updates to new release version
32+
sed -i "s/\(sigstore-gradle-sign-plugin:\)$previous_version/\1$release_version/" build-logic/publishing/build.gradle.kts
33+
sed -i "s/\(<version>\)$previous_version/\1$release_version/" sigstore-maven-plugin/README.md
34+
sed -i "s/\(dev.sigstore.sign\") version \"\)$previous_version/\1$release_version/" sigstore-gradle/README.md
35+
36+
# update to latest dev version
37+
sed -i "s/\(sigstoreJavaVersion.convention(\"\)$release_version/\1$next_version/" sigstore-gradle/sigstore-gradle-sign-base-plugin/src/main/kotlin/dev/sigstore/sign/SigstoreSignExtension.kt
38+
sed -i "s/version=$release_version/version=$next_version/" gradle.properties

sigstore-gradle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Signature format uses [Sigstore bundle](https://github.com/sigstore/protobuf-spe
1616

1717
```kotlin
1818
plugins {
19-
id("dev.sigstore.sign")
19+
id("dev.sigstore.sign") version "0.11.0"
2020
}
2121

2222
// Automatically sign all Maven publications, using GitHub Actions OIDC when available,

sigstore-maven-plugin/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)