Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Version to VersionNumber #45

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "PSRContinuousDeployment"
uuid = "f0087d4c-ff99-426e-93c9-09c1a88911f9"
version = "0.9.2"
version = "0.10.0"

[deps]
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
Expand Down
1 change: 0 additions & 1 deletion src/PSRContinuousDeployment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ include("testrunner.jl")

include("deploy/psrmodels.jl")
include("deploy/psrmodules.jl")
include("deploy/psrcloud.jl")
include("deploy/distribution.jl")

end
4 changes: 2 additions & 2 deletions src/configuration.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct Configuration
target::String
version::String
version::VersionNumber
package_path::String
compile_path::String
build_path::String
Expand Down Expand Up @@ -31,7 +31,7 @@ struct Configuration

return new(
target,
version,
VersionNumber(version),
package_path,
compile_path,
build_path,
Expand Down
63 changes: 0 additions & 63 deletions src/deploy/psrcloud.jl

This file was deleted.

8 changes: 7 additions & 1 deletion src/deploy/psrmodels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ function get_key(contents::Dict)
return contents["Key"]
end

function generate_unique_key(; bucket::AbstractString, version::AbstractString, target::AbstractString, setup_zip::AbstractString, overwrite::Bool = false)
function generate_unique_key(;
bucket::AbstractString,
version::VersionNumber,
target::AbstractString,
setup_zip::AbstractString,
overwrite::Bool = false,
)
objects = S3.list_objects_v2(bucket, Dict("prefix" => target))
if haskey(objects, "Contents")
for contents in objects["Contents"]
Expand Down
2 changes: 1 addition & 1 deletion src/github.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function is_release_tag_available(configuration::Configuration, github_key::Abst
]

target = configuration.target
version = configuration.version
version = VersionNumber(configuration.version.major, configuration.version.minor, configuration.version.patch)

try
HTTP.get("https://api.github.com/repos/psrenergy/$target.jl/releases/tags/v$version", headers)
Expand Down
2 changes: 1 addition & 1 deletion src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function create_setup(
url = "http://www.psr-inc.com"

# Build id from target and version
rng = Random.MersenneTwister(hash(target * version))
rng = Random.MersenneTwister(hash("$target$version"))
id = UUIDs.uuid4(rng) |> string |> uppercase

if !isdir(setup_path)
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function write_version_jl(
path::AbstractString,
sha1::AbstractString,
date::AbstractString,
pkg_version::AbstractString,
pkg_version::VersionNumber,
pkg_build_date::AbstractString,
)
open(joinpath(path, "version.jl"), "w") do io
Expand Down
2 changes: 1 addition & 1 deletion test/Example.jl/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Example"
uuid = "28d347f4-7536-4c5e-b41f-4013aab74eac"
version = "0.1.0"
version = "0.2.0"

[deps]

Expand Down