diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index cf3bec24..34932231 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -7,7 +7,7 @@ on: description: "Version of swiftly to build release artifacts" required: true type: string - default: "0.4.0-dev" + default: "0.4.0" skip: description: "Perform release checks, such as the git tag, and swift version, or '--skip' to skip that." required: true diff --git a/Sources/Swiftly/Init.swift b/Sources/Swiftly/Init.swift index ce8fc7b2..58053657 100644 --- a/Sources/Swiftly/Init.swift +++ b/Sources/Swiftly/Init.swift @@ -37,8 +37,22 @@ internal struct Init: SwiftlyCommand { var config = try? Config.load() + if var config, !overwrite && config.version == SwiftlyVersion(major: 0, minor: 4, patch: 0, suffix: "dev") { + // This is a simple upgrade from the 0.4.0-dev pre-release + + // Move our executable over to the correct place + try Swiftly.currentPlatform.installSwiftlyBin() + + // Update and save the version + config.version = SwiftlyCore.version + + try config.save() + + return + } + if let config, !overwrite && config.version != SwiftlyCore.version { - // We don't support downgrades, and we don't yet support upgrades + // We don't support downgrades, and versions prior to 0.4.0-dev throw SwiftlyError(message: "An existing swiftly installation was detected. You can try again with '--overwrite' to overwrite it.") } diff --git a/Sources/SwiftlyCore/SwiftlyCore.swift b/Sources/SwiftlyCore/SwiftlyCore.swift index 5d2754a2..1988ef3b 100644 --- a/Sources/SwiftlyCore/SwiftlyCore.swift +++ b/Sources/SwiftlyCore/SwiftlyCore.swift @@ -1,6 +1,6 @@ import Foundation -public let version = SwiftlyVersion(major: 0, minor: 4, patch: 0, suffix: "dev") +public let version = SwiftlyVersion(major: 0, minor: 4, patch: 0) /// A separate home directory to use for testing purposes. This overrides swiftly's default /// home directory location logic.