Skip to content

Commit 92f54bd

Browse files
authored
Prepare for the 0.4.0 release (#214)
Bump version to the 0.4.0 release and add upgrade routine from 0.4.0-dev. Upate the github workflow default for making a release from main branch.
1 parent 1d5d84d commit 92f54bd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/build_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
description: "Version of swiftly to build release artifacts"
88
required: true
99
type: string
10-
default: "0.4.0-dev"
10+
default: "0.4.0"
1111
skip:
1212
description: "Perform release checks, such as the git tag, and swift version, or '--skip' to skip that."
1313
required: true

Sources/Swiftly/Init.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,22 @@ internal struct Init: SwiftlyCommand {
3737

3838
var config = try? Config.load()
3939

40+
if var config, !overwrite && config.version == SwiftlyVersion(major: 0, minor: 4, patch: 0, suffix: "dev") {
41+
// This is a simple upgrade from the 0.4.0-dev pre-release
42+
43+
// Move our executable over to the correct place
44+
try Swiftly.currentPlatform.installSwiftlyBin()
45+
46+
// Update and save the version
47+
config.version = SwiftlyCore.version
48+
49+
try config.save()
50+
51+
return
52+
}
53+
4054
if let config, !overwrite && config.version != SwiftlyCore.version {
41-
// We don't support downgrades, and we don't yet support upgrades
55+
// We don't support downgrades, and versions prior to 0.4.0-dev
4256
throw SwiftlyError(message: "An existing swiftly installation was detected. You can try again with '--overwrite' to overwrite it.")
4357
}
4458

Sources/SwiftlyCore/SwiftlyCore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public let version = SwiftlyVersion(major: 0, minor: 4, patch: 0, suffix: "dev")
3+
public let version = SwiftlyVersion(major: 0, minor: 4, patch: 0)
44

55
/// A separate home directory to use for testing purposes. This overrides swiftly's default
66
/// home directory location logic.

0 commit comments

Comments
 (0)