Skip to content

Commit

Permalink
add version updater
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
loosebazooka committed Aug 13, 2024
1 parent 7cc85ad commit 27c57e5
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 88 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ Full release instructions are at: [RELEASING.md](/sigstore/sigstore-java/blob/ma
- [ ] [sigstore-java](https://repo1.maven.org/maven2/dev/sigstore/sigstore-java)
- [ ] [sigstore-maven-plugin](https://repo1.maven.org/maven2/dev/sigstore/sigstore-maven-plugin)
- [ ] sigstore-gradle-plugin [[base](https://plugins.gradle.org/plugin/dev.sigstore.sign-base)], [[sign](https://plugins.gradle.org/plugin/dev.sigstore.sign)]

## Post Release
- [ ] Update README if required
- [ ] Update versions (`./scripts/update_version.sh`)
- [ ] Update CHANGELOG.md
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.gradle
/build
/*/build
/**/build
/out
/*/out
/**/out
/http

/target
/**/target
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

# For occasional use of https://github.com/melix/includegit-gradle-plugin
/checkouts

Expand All @@ -20,6 +25,9 @@
.classpath
.project
.DS_Store
.vscode
.factorypath

# except this icon
!/.idea/icon.png

4 changes: 4 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## Create an issue

Create a release issue using the release template

## Create a tag

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).
Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true

group=dev.sigstore

# remember to also update version in
# - SigstoreSignExtension.kt
# - build-logic/publishing/build.gradle.kts
# use the ./scripts/update_version.sh script to update all versions
version=0.12.0
1 change: 0 additions & 1 deletion scripts/.gitignore

This file was deleted.

57 changes: 0 additions & 57 deletions scripts/sign_and_bundle_release.sh

This file was deleted.

38 changes: 38 additions & 0 deletions scripts/update_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# this script is simple and should work for most usecases, but it may break if we do weird things
set -Eeo pipefail

calculated_release_version=$(grep "^version=" gradle.properties | cut -d'=' -f2)
read -r -p "Enter released version [${calculated_release_version}]: " vin
release_version=${vin:-${calculated_release_version}}

calculated_previous_version=$(grep "sigstore-gradle-sign-plugin" build-logic/publishing/build.gradle.kts | cut -d':' -f3 | cut -d'"' -f1)
read -r -p "Enter previous version [${calculated_previous_version}]: " pvin
previous_version=${pvin:-${calculated_previous_version}}

calculated_next_version=$(echo "$release_version" | awk -F. -v OFS=. '{$2 += 1 ; print}')
read -r -p "Enter next version [${calculated_next_version}]: " nvin
next_version=${nvin:-${calculated_next_version}}

echo ""
echo "previous: $previous_version"
echo "latest : $release_version"
echo "next : $next_version"
read -r -p "Run update? [y/N]: " yn
go=${yn:-"n"}
if [ "${go,,}" != "y" ]; then
echo "aborting"
exit
fi

# sed below is probably accepting .'s in versions as regex any chars, but this works for our purposes

# updates to new release version
sed -i "s/\(sigstore-gradle-sign-plugin:\)$previous_version/\1$release_version/" build-logic/publishing/build.gradle.kts
sed -i "s/\(<version>\)$previous_version/\1$release_version/" sigstore-maven-plugin/README.md
sed -i "s/\(dev.sigstore.sign\") version \"\)$previous_version/\1$release_version/" sigstore-gradle/README.md

# update to latest dev version
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
sed -i "s/version=$release_version/version=$next_version/" gradle.properties
2 changes: 1 addition & 1 deletion sigstore-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Signature format uses [Sigstore bundle](https://github.com/sigstore/protobuf-spe

```kotlin
plugins {
id("dev.sigstore.sign")
id("dev.sigstore.sign") version "0.11.0"
}

// Automatically sign all Maven publications, using GitHub Actions OIDC when available,
Expand Down
24 changes: 0 additions & 24 deletions sigstore-maven-plugin/.gitignore

This file was deleted.

0 comments on commit 27c57e5

Please sign in to comment.