Skip to content

Commit

Permalink
Automate uniform release version setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Aug 13, 2024
1 parent 5ae3eb4 commit 4aba9d5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if useLocalFramework {
path: "./common/target/ios/libferrostar-rs.xcframework"
)
} else {
let releaseTag = "0.7.1"
let releaseTag = "0.7.2"
let releaseChecksum = "80a896da507770f5fd8931739e813e1d46ec67cfa46597ea646aa2fb9f6f4a30"
binaryTarget = .binaryTarget(
name: "FerrostarCoreRS",
Expand Down
8 changes: 4 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

When cutting a release, follow this checklist:

1. Ensure that all version strings are up to date.
Currently this means checking `common/ferrostar/Cargo.toml`, `Package.swift`, and `android/build.gradle`.
2. Create a GitHub release and use the new version as the tag name (not that it must be in X.Y.Z format to please SPM).
3. Sit back and watch. GitHub actions take care of the rest.
1. Run `./update-release-version.sh X.Y.Z` with the new version string. Note that this is currently macOS-specific given the vagaries of GNU sed.
2. Commit staged changes and push.
3. Create a GitHub release and use the new version as the tag name (not that it must be in X.Y.Z format to please SPM).
4. Sit back and watch. GitHub actions take care of the rest.
Note that iOS CI ends up adding a commit due to the way binary checksumming works.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ publishing {

allprojects {
group = "com.stadiamaps.ferrostar"
version = "0.7.1"
version = "0.7.2"
}
2 changes: 1 addition & 1 deletion common/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/ferrostar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lints.workspace = true

[package]
name = "ferrostar"
version = "0.7.1"
version = "0.7.2"
readme = "README.md"
description = "The core of modern turn-by-turn navigation."
keywords = ["navigation", "routing", "valhalla", "osrm"]
Expand Down
12 changes: 12 additions & 0 deletions update-release-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env zsh

set -e
set -u

version=$1
sed -i "" -E "s/(let releaseTag = \")[^\"]+(\")/\1$version\2/g" Package.swift
sed -i "" -E "s/(version = \")[^\"]+(\")/\1$version\2/g" android/build.gradle
awk '{ if (!done && /version = \"/) { sub(/(version = \")[^\"]+(\")/, "version = \"" newVersion "\""); done=1 } print }' newVersion="$version" common/ferrostar/Cargo.toml > tmpfile && mv tmpfile common/ferrostar/Cargo.toml
cd common && cargo check && cd ..

git add Package.swift android/build.gradle common/Cargo.lock common/ferrostar/Cargo.toml

0 comments on commit 4aba9d5

Please sign in to comment.