From caf169d13d928991fa360615f56ed4e7246cfba2 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Mon, 2 Jun 2025 15:56:28 -0700 Subject: [PATCH 1/2] Update version to 6.2.0 --- Sources/swift-format/PrintVersion.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/swift-format/PrintVersion.swift b/Sources/swift-format/PrintVersion.swift index 15b90e48a..9cc1f6881 100644 --- a/Sources/swift-format/PrintVersion.swift +++ b/Sources/swift-format/PrintVersion.swift @@ -12,5 +12,5 @@ func printVersionInformation() { // TODO: Automate updates to this somehow. - print("main") + print("6.2.0") } From 2d3f1f214980ca7c24cf501221e2d07b0f35d187 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Mon, 2 Jun 2025 16:06:06 -0700 Subject: [PATCH 2/2] Check version has been updated when publishing a release Rather than updating the version, check that it has been. We need the update in the branch itself so that the toolchain version is also updated. --- .github/workflows/publish_release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 21c32497b..4e95fc940 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -67,6 +67,9 @@ jobs: echo "swift_format_version=$SWIFT_FORMAT_VERSION" >> "$GITHUB_OUTPUT" - name: Checkout repository uses: actions/checkout@v4 + - name: Check version matches + run: | + grep '"${{ steps.swift_format_version.outputs.swift_format_version }}"' Sources/swift-format/PrintVersion.swift - name: Create release commits id: create_release_commits run: | @@ -81,10 +84,6 @@ jobs: git add Package.swift git commit -m "Change swift-syntax dependency to ${{ steps.swift_syntax_tag.outputs.swift_syntax_tag }}" - sed -E -i "s#print\(\".*\"\)#print\(\"${{ steps.swift_format_version.outputs.swift_format_version }}\"\)#" Sources/swift-format/PrintVersion.swift - git add Sources/swift-format/PrintVersion.swift - git commit -m "Change version to ${{ steps.swift_format_version.outputs.swift_format_version }}" - { echo 'release_commit_patch<