From cb8c1248caf889b750784284fcc9e2d2545702c5 Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:31:58 -0800 Subject: [PATCH 1/4] Add release_instructions.md. --- release_instructions.md | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 release_instructions.md diff --git a/release_instructions.md b/release_instructions.md new file mode 100644 index 0000000..4418b64 --- /dev/null +++ b/release_instructions.md @@ -0,0 +1,59 @@ +# Release Instructions + +These are the steps to create a new onnxruntime-swift-package-manager release. +Typically, an onnxruntime-swift-package-manager release will follow soon after an onnxruntime release. + +## 1. Sync onnxruntime Objective-C source files + +Check out the corresponding onnxruntime release version, i.e., a release tag. +``` +cd +git checkout +``` + +Sync the onnxruntime Objective-C source files. +``` +# Replace objectivec directory. +rm -r /objectivec +cp -r /objectivec /objectivec + +# Remove objectivec subdirectories that are not used by this repo. +# The following directories are unused as of onnxruntime 1.20. +rm -r /objectivec/docs +rm -r /objectivec/test +``` + + +## 2. Update dependency versions in Package.swift + +Find the onnxruntime and onnxruntime-extensions binary target configuration in the Package.swift file. For example: + +https://github.com/microsoft/onnxruntime-swift-package-manager/blob/bbc428e168a0374eb7d0503cdb7c73fdc1d99751/Package.swift#L98-L104 + +https://github.com/microsoft/onnxruntime-swift-package-manager/blob/bbc428e168a0374eb7d0503cdb7c73fdc1d99751/Package.swift#L110-L116 + + +```swift + // ORT release + package.targets.append( + Target.binaryTarget(name: "onnxruntime", + url: "https://download.onnxruntime.ai/pod-archive-onnxruntime-c-1.19.2.zip", + // ^^^^^^ Update version + // SHA256 checksum + checksum: "28787ee2f966a2c47eb293322c733c5dc4b5e3327cec321c1fe31a7c698edf68") + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Update checksum + ) +``` + +Update the version in the URL and checksum for both onnxruntime and onnxruntime-extensions targets. + +To compute the checksum, download the file from the updated URL and compute its SHA256 checksum (e.g., with `sha256sum` on Linux or MacOS). + + +## 3. Check in updates and create a release + +Check in the changes made in the previous steps to `main`. + +Note: This repo is updated relatively infrequently, so we currently do not have a release process that uses a separate release branch. + +Create the release tag from the `main`. The tag should match the tag of the corresponding onnxruntime version, e.g., `v1.20.0`. From 9d8272e71c6edce534ac0df8ffcdb7dc5c8edc71 Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:07:05 -0800 Subject: [PATCH 2/4] update sync instructions --- release_instructions.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/release_instructions.md b/release_instructions.md index 4418b64..8dd8a4f 100644 --- a/release_instructions.md +++ b/release_instructions.md @@ -16,11 +16,6 @@ Sync the onnxruntime Objective-C source files. # Replace objectivec directory. rm -r /objectivec cp -r /objectivec /objectivec - -# Remove objectivec subdirectories that are not used by this repo. -# The following directories are unused as of onnxruntime 1.20. -rm -r /objectivec/docs -rm -r /objectivec/test ``` From 7b55815da67435e9de1c53ac7165adc9b9891f66 Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:23:43 -0800 Subject: [PATCH 3/4] address PR comments --- release_instructions.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/release_instructions.md b/release_instructions.md index 8dd8a4f..661a35f 100644 --- a/release_instructions.md +++ b/release_instructions.md @@ -27,7 +27,6 @@ https://github.com/microsoft/onnxruntime-swift-package-manager/blob/bbc428e168a0 https://github.com/microsoft/onnxruntime-swift-package-manager/blob/bbc428e168a0374eb7d0503cdb7c73fdc1d99751/Package.swift#L110-L116 - ```swift // ORT release package.targets.append( @@ -41,14 +40,26 @@ https://github.com/microsoft/onnxruntime-swift-package-manager/blob/bbc428e168a0 ``` Update the version in the URL and checksum for both onnxruntime and onnxruntime-extensions targets. +To get the checksum value, download the file from the updated URL and compute its SHA256 checksum. -To compute the checksum, download the file from the updated URL and compute its SHA256 checksum (e.g., with `sha256sum` on Linux or MacOS). +To compute a SHA256 checksum on Linux or MacOS: +``` +sha256sum pod-archive-onnxruntime-c-x.y.z.zip +``` + +To compute a SHA256 checksum on Windows with Powershell: +``` +(Get-FileHash -Algorithm SHA256 pod-archive-onnxruntime-c-x.y.z.zip).Hash.ToLower() +``` ## 3. Check in updates and create a release -Check in the changes made in the previous steps to `main`. - Note: This repo is updated relatively infrequently, so we currently do not have a release process that uses a separate release branch. -Create the release tag from the `main`. The tag should match the tag of the corresponding onnxruntime version, e.g., `v1.20.0`. +Check in the changes made in the previous steps to the `main` branch. + +Create a release tag from the `main` branch. + +The tag should match the tag of the corresponding onnxruntime release excluding the leading `v`. +E.g., for onnxruntime tag `v1.20.0`, the onnxruntime-swift-package-manager tag should be `1.20.0`. From 4d1dc0e86b04d73c01b44042ee9d1bec7846ac97 Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:26:40 -0800 Subject: [PATCH 4/4] add some rationale for tag naming --- release_instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_instructions.md b/release_instructions.md index 661a35f..5b9dbc8 100644 --- a/release_instructions.md +++ b/release_instructions.md @@ -61,5 +61,5 @@ Check in the changes made in the previous steps to the `main` branch. Create a release tag from the `main` branch. -The tag should match the tag of the corresponding onnxruntime release excluding the leading `v`. +The tag should match the tag of the corresponding onnxruntime release excluding the leading `v` in order to make it a valid semantic version string. E.g., for onnxruntime tag `v1.20.0`, the onnxruntime-swift-package-manager tag should be `1.20.0`.