Skip to content

Commit

Permalink
Prepare for the 0.4.0 release (#214)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cmcgee1024 authored Feb 3, 2025
1 parent 1d5d84d commit 92f54bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 15 additions & 1 deletion Sources/Swiftly/Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftlyCore/SwiftlyCore.swift
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 92f54bd

Please sign in to comment.