Skip to content

Commit 4d6555f

Browse files
authored
Merge pull request #12 from magnusuMET/release_workflow
Release workflow
2 parents 8c8241f + d6a6f62 commit 4d6555f

File tree

7 files changed

+58
-14
lines changed

7 files changed

+58
-14
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
tags:
7+
- "hdf5-src-v*"
8+
- "hdf5-sys-v*"
9+
- "hdf5-derive-v*"
10+
- "hdf5-types-v*"
11+
- "hdf5-v*"
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
release:
18+
name: release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: true
25+
- name: Install libhdf5
26+
run: sudo apt-get update && sudo apt-get install libhdf5-dev
27+
- name: Install rust
28+
uses: dtolnay/rust-toolchain@stable
29+
with:
30+
toolchain: stable
31+
- name: Publish hdf5-src
32+
if: "${{ startsWith(github.ref_name, 'hdf5-src-v') }}"
33+
run: cargo publish --package hdf5-metno-src --token "${{ secrets.CRATES_IO_TOKEN }}"
34+
- name: Publish hdf5-sys
35+
if: "${{ startsWith(github.ref_name, 'hdf5-sys-v') }}"
36+
run: cargo publish --package hdf5-metno-sys --token "${{ secrets.CRATES_IO_TOKEN }}"
37+
- name: Publish hdf5-derive
38+
if: "${{ startsWith(github.ref_name, 'hdf5-metno-derive-v') }}"
39+
run: cargo publish --package hdf5-metno-derive --token "${{ secrets.CRATES_IO_TOKEN }}"
40+
- name: Publish hdf5-types
41+
if: "${{ startsWith(github.ref_name, 'hdf5-metno-types-v') }}"
42+
run: cargo publish --package hdf5-metno-types --token "${{ secrets.CRATES_IO_TOKEN }}"
43+
- name: Publish hdf5
44+
if: "${{ startsWith(github.ref_name, 'hdf5-v') }}"
45+
run: cargo publish --package hdf5-metno --token "${{ secrets.CRATES_IO_TOKEN }}"

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ members = ["hdf5", "hdf5-types", "hdf5-derive", "hdf5-sys", "hdf5-src"]
44
default-members = ["hdf5", "hdf5-types", "hdf5-derive", "hdf5-sys"]
55

66
[workspace.package]
7-
version = "0.9.2" # !V
87
rust-version = "1.80.0"
98
authors = [
109
"Ivan Smirnov <[email protected]>",

hdf5-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "hdf5-metno-derive"
33
description = "Derive macro for HDF5 structs and enums."
44
categories = ["development-tools::procedural-macro-helpers"]
55
readme = "README.md"
6-
version.workspace = true
6+
version = "0.9.0" # !V
77
rust-version.workspace = true
88
authors.workspace = true
99
keywords.workspace = true

hdf5-src/build.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ fn configure_cmake_cross_run_advanced_cache_vars(cfg: &mut cmake::Config) {
2323
"H5_NO_ALIGNMENT_RESTRICTIONS_RUN",
2424
"H5_NO_ALIGNMENT_RESTRICTIONS_RUN__TRYRUN_OUTPUT",
2525
] {
26-
println!("cargo:rerun-if-env-changed={option}");
26+
println!("cargo::rerun-if-env-changed={option}");
2727
let value = env::var(option).unwrap_or_else(|_| "OFF".to_string());
2828
cfg.define(option, value);
2929
}
3030
}
3131

3232
fn main() {
33-
println!("cargo:rerun-if-changed=build.rs");
33+
println!("cargo::rerun-if-changed=build.rs");
3434
let mut cfg = cmake::Config::new("ext/hdf5");
3535

3636
// only build the static c library, disable everything else
@@ -70,8 +70,8 @@ fn main() {
7070
cfg.define("HDF5_ENABLE_Z_LIB_SUPPORT", "ON")
7171
.define("H5_ZLIB_HEADER", &zlib_header)
7272
.define("ZLIB_STATIC_LIBRARY", zlib_lib);
73-
println!("cargo:zlib_header={}", zlib_header.to_str().unwrap());
74-
println!("cargo:zlib={}", zlib_lib);
73+
println!("cargo::metadata=zlib_header={}", zlib_header.to_str().unwrap());
74+
println!("cargo::metadata=zlib={}", zlib_lib);
7575
} else {
7676
cfg.define("HDF5_ENABLE_Z_LIB_SUPPORT", "OFF");
7777
}
@@ -83,7 +83,7 @@ fn main() {
8383
if feature_enabled("THREADSAFE") {
8484
cfg.define("HDF5_ENABLE_THREADSAFE", "ON");
8585
if feature_enabled("HL") {
86-
println!("cargo:warning=Unsupported HDF5 options: hl with threadsafe.");
86+
println!("cargo::warning=Unsupported HDF5 options: hl with threadsafe.");
8787
cfg.define("ALLOW_UNSUPPORTED", "ON");
8888
}
8989
}
@@ -100,7 +100,7 @@ fn main() {
100100
hdf5_hl_lib.push_str(debug_postfix);
101101
}
102102
}
103-
println!("cargo:hl_library={}", hdf5_hl_lib);
103+
println!("cargo::metadata=hl_library={}", hdf5_hl_lib);
104104
}
105105

106106
if cfg!(unix) && targeting_windows {
@@ -112,10 +112,10 @@ fn main() {
112112

113113
configure_cmake_cross_run_advanced_cache_vars(&mut cfg);
114114
let dst = cfg.build();
115-
println!("cargo:root={}", dst.display());
115+
println!("cargo::metadata=root={}", dst.display());
116116

117117
let hdf5_incdir = format!("{}/include", dst.display());
118-
println!("cargo:include={}", hdf5_incdir);
118+
println!("cargo::metadata=include={}", hdf5_incdir);
119119

120120
let mut hdf5_lib = if cfg!(target_env = "msvc") { "libhdf5" } else { "hdf5" }.to_owned();
121121
if let Ok(opt_level) = env::var("OPT_LEVEL") {
@@ -124,5 +124,5 @@ fn main() {
124124
}
125125
}
126126

127-
println!("cargo:library={}", hdf5_lib);
127+
println!("cargo::metadata=library={}", hdf5_lib);
128128
}

hdf5-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Native bindings to the HDF5 library."
55
links = "hdf5"
66
readme = "README.md"
77
categories = ["development-tools::ffi", "filesystem", "science"]
8-
version.workspace = true
8+
version = "0.9.1" # !V
99
rust-version.workspace = true
1010
authors.workspace = true
1111
keywords.workspace = true

hdf5-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "Native Rust equivalents of HDF5 types."
44
readme = "README.md"
55
build = "build.rs"
66
categories = ["encoding"]
7-
version.workspace = true
7+
version = "0.9.0" # !V
88
rust-version.workspace = true
99
authors.workspace = true
1010
keywords.workspace = true

hdf5/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ readme = "../README.md"
44
description = "Thread-safe Rust bindings for the HDF5 library."
55
build = "build.rs"
66
categories = ["science", "filesystem"]
7-
version.workspace = true
7+
version = "0.9.2" # !V
88
rust-version.workspace = true
99
authors.workspace = true
1010
keywords.workspace = true

0 commit comments

Comments
 (0)