Skip to content

Commit

Permalink
FEATURE: Automatic version extraction in the tarball build script
Browse files Browse the repository at this point in the history
  • Loading branch information
tmasthay committed Jun 16, 2024
1 parent 82f8cc4 commit 3d0a032
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/julia/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pkg.activate(".")
using BinaryBuilder

name = "Madagascar"
version = v"1.0.0"
version = v"4.1"

# Collection of sources required to complete build
sources = [
Expand Down
2 changes: 1 addition & 1 deletion api/julia/tarball_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pkg.activate(".")
using BinaryBuilder

name = "Madagascar"
version = v"1.0.0"
version = v"!?VERSION!?"

# Collection of sources required to complete build
sources = [
Expand Down
5 changes: 3 additions & 2 deletions api/julia/update_tarball_script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ function main(output_file::String; lib_unsupported::AbstractArray{String}=[], bi
`git ls-remote https://github.com/ahay/src.git`,
`grep "madagascar-[0-9][0-9]*[.].*"`,
`tail -n 1`,
`awk '{print $1}'`
)

latest_remote_hash = strip(read(command, String))
latest_remote_hash, latest_version = split(read(command, String))
latest_version = replace(latest_version, "refs/heads/madagascar-" => "")

curr_dir = dirname(@__FILE__)
base_file_contents = read("$curr_dir/tarball_base.jl", String)


final_file_contents = replace(
base_file_contents,
"\"!?VERSION!?\"" => "\"$latest_version\"",
"\"!?MADAGASCAR_HASH!?\"" => "\"$latest_remote_hash\"",
"\"!?DEPENDENT_EXECUTABLES!?\"" => final_build_string)

Expand Down

0 comments on commit 3d0a032

Please sign in to comment.